Repository: ViRb3/wgcf Branch: master Commit: 6e1d9601880a Files: 97 Total size: 473.0 KB Directory structure: gitextract_rfy_bp79/ ├── .github/ │ ├── dependabot.yml │ └── workflows/ │ ├── release.yml │ └── test.yml ├── .gitignore ├── .goreleaser.yml ├── .releaserc.json ├── Dockerfile ├── LICENSE ├── README.md ├── cloudflare/ │ ├── api.go │ └── util.go ├── cmd/ │ ├── generate/ │ │ └── generate.go │ ├── register/ │ │ └── register.go │ ├── root.go │ ├── shared/ │ │ └── shared.go │ ├── status/ │ │ └── status.go │ ├── trace/ │ │ └── trace.go │ └── update/ │ └── update.go ├── config/ │ └── config.go ├── go.mod ├── go.sum ├── main.go ├── openapi/ │ ├── .gitignore │ ├── .openapi-generator/ │ │ ├── FILES │ │ └── VERSION │ ├── .openapi-generator-ignore │ ├── .travis.yml │ ├── README.md │ ├── api/ │ │ └── openapi.yaml │ ├── api_default.go │ ├── client.go │ ├── configuration.go │ ├── docs/ │ │ ├── Account.md │ │ ├── BoundDevice.md │ │ ├── Config.md │ │ ├── ConfigInterface.md │ │ ├── ConfigServices.md │ │ ├── DefaultApi.md │ │ ├── Endpoint.md │ │ ├── GetClientConfig200Response.md │ │ ├── GetClientConfig200ResponseCaptivePortalInner.md │ │ ├── GetClientConfig200ResponseCaptivePortalInnerNetworksInner.md │ │ ├── GetClientConfig200ResponseDenylistInner.md │ │ ├── GetClientConfig200ResponseDenylistInnerNetworks.md │ │ ├── GetSourceDevice200Response.md │ │ ├── IPv4Network.md │ │ ├── IPv6Network.md │ │ ├── NetworkAddress.md │ │ ├── Peer.md │ │ ├── Register200Response.md │ │ ├── RegisterRequest.md │ │ ├── ResetAccountLicense200Response.md │ │ ├── SourceDevice.md │ │ ├── UpdateAccount200Response.md │ │ ├── UpdateAccountRequest.md │ │ ├── UpdateBoundDeviceRequest.md │ │ ├── UpdateSourceDevice200Response.md │ │ └── UpdateSourceDeviceRequest.md │ ├── git_push.sh │ ├── go.mod │ ├── go.sum │ ├── model_account.go │ ├── model_bound_device.go │ ├── model_config.go │ ├── model_config_interface.go │ ├── model_config_services.go │ ├── model_endpoint.go │ ├── model_get_client_config_200_response.go │ ├── model_get_client_config_200_response_captive_portal_inner.go │ ├── model_get_client_config_200_response_captive_portal_inner_networks_inner.go │ ├── model_get_client_config_200_response_denylist_inner.go │ ├── model_get_client_config_200_response_denylist_inner_networks.go │ ├── model_get_source_device_200_response.go │ ├── model_ipv4_network.go │ ├── model_ipv6_network.go │ ├── model_network_address.go │ ├── model_peer.go │ ├── model_register_200_response.go │ ├── model_register_request.go │ ├── model_reset_account_license_200_response.go │ ├── model_source_device.go │ ├── model_update_account_200_response.go │ ├── model_update_account_request.go │ ├── model_update_bound_device_request.go │ ├── model_update_source_device_200_response.go │ ├── model_update_source_device_request.go │ ├── response.go │ ├── test/ │ │ └── api_default_test.go │ └── utils.go ├── openapi-spec.yml ├── openapitools.json ├── util/ │ ├── util.go │ └── util_test.go └── wireguard/ ├── keys.go ├── keys_test.go ├── profile.go └── profile_test.go ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/dependabot.yml ================================================ version: 2 updates: - package-ecosystem: "gomod" directory: "/" schedule: interval: "daily" commit-message: prefix: "fix" include: "scope" open-pull-requests-limit: 20 - package-ecosystem: "docker" directory: "/" schedule: interval: "daily" commit-message: prefix: "fix" include: "scope" open-pull-requests-limit: 20 - package-ecosystem: "github-actions" directory: "/" schedule: interval: "daily" commit-message: prefix: "fix" include: "scope" open-pull-requests-limit: 20 ================================================ FILE: .github/workflows/release.yml ================================================ name: Release on: push: tags: - "*" jobs: docker: runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v6.0.1 with: token: ${{ secrets.API_GITHUB_TOKEN }} - name: Docker meta id: docker_meta uses: docker/metadata-action@v5.10.0 with: images: ${{ github.repository }} tags: | type=semver,pattern={{major}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}}.{{minor}}.{{patch}} type=semver,pattern={{version}} - name: Set up QEMU uses: docker/setup-qemu-action@v3.7.0 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3.12.0 - name: Login to DockerHub uses: docker/login-action@v3.6.0 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push uses: docker/build-push-action@v6.18.0 with: push: true platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} binaries: runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v6.0.1 with: token: ${{ secrets.API_GITHUB_TOKEN }} - name: Fetch Go version run: | GO_VERSION=$(perl -ne 'print "$1\n" if /FROM golang:([0-9.]+)/' Dockerfile | head -n1) [ -n "$GO_VERSION" ] || exit 1 echo "go_version=$GO_VERSION" >> $GITHUB_ENV - name: Setup Go environment uses: actions/setup-go@v6.1.0 with: go-version: "${{ env.go_version }}" - name: Binaries Release uses: goreleaser/goreleaser-action@v6.4.0 with: version: ~> 2.7.0 args: release --clean env: GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }} ================================================ FILE: .github/workflows/test.yml ================================================ name: Test on: push: branches: [master, develop] pull_request: branches: [master, develop] jobs: build: runs-on: ubuntu-24.04 steps: - name: Checkout with token if: github.event_name != 'pull_request' uses: actions/checkout@v6.0.1 with: token: ${{ secrets.API_GITHUB_TOKEN }} - name: Checkout without token if: github.event_name == 'pull_request' uses: actions/checkout@v6.0.1 - name: Fetch Go version run: | GO_VERSION=$(perl -ne 'print "$1\n" if /FROM golang:([0-9.]+)/' Dockerfile | head -n1) [ -n "$GO_VERSION" ] || exit 1 echo "go_version=$GO_VERSION" >> $GITHUB_ENV - name: Setup Go environment uses: actions/setup-go@v6.1.0 with: go-version: "${{ env.go_version }}" - name: Program Test run: go test ./... - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3.12.0 - name: Docker Build Test run: docker buildx build --load --tag test:test --file ./Dockerfile ./ - name: Version if: github.event_name != 'pull_request' uses: cycjimmy/semantic-release-action@v6.0.0 with: semantic_version: 24.2.3 env: GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }} ================================================ FILE: .gitignore ================================================ /.optic/captures/ /.optic/generated/ /*.toml /*.conf /*.pcapng /wgcf .DS_Store # Created by https://www.gitignore.io/api/go,intellij+all,visualstudiocode # Edit at https://www.gitignore.io/?templates=go,intellij+all,visualstudiocode ### Go ### # Binaries for programs and plugins *.exe *.exe~ *.dll *.so *.dylib # Test binary, built with `go test -c` *.test # Output of the go coverage tool, specifically when used with LiteIDE *.out # Dependency directories (remove the comment below to include it) # vendor/ ### Go Patch ### /vendor/ /Godeps/ ### Intellij+all ### # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 # User-specific stuff .idea/**/workspace.xml .idea/**/tasks.xml .idea/**/usage.statistics.xml .idea/**/dictionaries .idea/**/shelf # Generated files .idea/**/contentModel.xml # Sensitive or high-churn files .idea/**/dataSources/ .idea/**/dataSources.ids .idea/**/dataSources.local.xml .idea/**/sqlDataSources.xml .idea/**/dynamic.xml .idea/**/uiDesigner.xml .idea/**/dbnavigator.xml # Gradle .idea/**/gradle.xml .idea/**/libraries # Gradle and Maven with auto-import # When using Gradle or Maven with auto-import, you should exclude module files, # since they will be recreated, and may cause churn. Uncomment if using # auto-import. # .idea/modules.xml # .idea/*.iml # .idea/modules # *.iml # *.ipr # CMake cmake-build-*/ # Mongo Explorer plugin .idea/**/mongoSettings.xml # File-based project format *.iws # IntelliJ out/ # mpeltonen/sbt-idea plugin .idea_modules/ # JIRA plugin atlassian-ide-plugin.xml # Cursive Clojure plugin .idea/replstate.xml # Crashlytics plugin (for Android Studio and IntelliJ) com_crashlytics_export_strings.xml crashlytics.properties crashlytics-build.properties fabric.properties # Editor-based Rest Client .idea/httpRequests # Android studio 3.1+ serialized cache file .idea/caches/build_file_checksums.ser ### Intellij+all Patch ### # Ignores the whole .idea folder and all .iml files # See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 .idea/ # Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 *.iml modules.xml .idea/misc.xml *.ipr # Sonarlint plugin .idea/sonarlint ### VisualStudioCode ### .vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json ### VisualStudioCode Patch ### # Ignore all local history of files .history # End of https://www.gitignore.io/api/go,intellij+all,visualstudiocode ================================================ FILE: .goreleaser.yml ================================================ before: builds: - env: - CGO_ENABLED=0 ldflags: - -s -w flags: - -trimpath goos: - linux - windows - darwin - freebsd goarch: - 386 - amd64 - arm - arm64 - mips - mipsle - mips64 - mips64le - s390x goarm: - 5 - 6 - 7 gomips: - softfloat archives: - format: binary checksum: name_template: "checksums.txt" ================================================ FILE: .releaserc.json ================================================ { "branches": [ { "name": "master" }, { "name": "develop", "prerelease": true } ], "plugins": [ "@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", [ "@semantic-release/github", { "successComment": false, "failComment": false } ] ] } ================================================ FILE: Dockerfile ================================================ FROM golang:1.25.5-alpine AS builder WORKDIR /src COPY . . RUN apk add --no-cache git && \ go mod download && \ CGO_ENABLED=0 go build -ldflags="-s -w" -o "wgcf" FROM alpine:3.23.2 WORKDIR / COPY --from=builder "/src/wgcf" "/" ENTRYPOINT ["/wgcf"] ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2020 ViRb3 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ # wgcf > wgcf is an unofficial, cross-platform CLI for [Cloudflare Warp](https://1.1.1.1/) ![](https://img.shields.io/drone/build/ViRb3/wgcf) ![](https://img.shields.io/github/issues/ViRb3/wgcf) ![](https://img.shields.io/github/downloads/ViRb3/wgcf/total) ![](https://img.shields.io/github/languages/code-size/ViRb3/wgcf) ## Features - Register new account - Change license key to use existing Warp+ subscription - Generate WireGuard profile - Check account status - Print trace information to debug Warp/Warp+ status ## Download You can find pre-compiled binaries on the [releases page](https://github.com/ViRb3/wgcf/releases). ## Usage Run `wgcf` in a terminal without any arguments to display the help screen. All commands and parameters are documented. ### Register new account Run the following command in a terminal: ```bash wgcf register ``` The new account will be saved under `wgcf-account.toml` ### Generate WireGuard profile Run the following command in a terminal: ```bash wgcf generate ``` The WireGuard profile will be saved under `wgcf-profile.conf`. For more information on how to use it, please check the official [WireGuard Quick Start](https://www.wireguard.com/quickstart/). #### Maximum transmission unit (MTU) To ensure maximum compatibility, the generated profile will have a MTU of 1280, just like the official Android app. If you are experiencing performance issues, you may be able to improve your speed by increasing this value. For more information, please check [#40](https://github.com/ViRb3/wgcf/issues/40). ### Add a license key If you have an existing Warp+ subscription, for example on your phone, you can bind the account generated by this tool to your phone's account, sharing its Warp+ status. Please note that there is a limit of 5 maximum devices linked at a time. You can remove linked devices from the 1.1.1.1 app on your phone. > [!CAUTION] > Only subscriptions purchased directly from the official 1.1.1.1 app are supported. Keys obtained by any other means, including referrals, will not work and will not be supported. First, get your Warp+ account license key. To view it on Android: 1. Open the `1.1.1.1` app 2. Click on the hamburger menu button in the top-right corner 3. Navigate to: `Account` > `Key` Now, back to wgcf. > [!WARNING] > There's a bug on Cloudflare's side that prevents existing accounts from getting Warp+ even after you bind a correct license key. If you have ever connected to Warp VPN, then your account is affected. You will need to make a new account via: > > ```wgcf register > wgcf register > ``` > Then immediately proceed with the steps below, without running any other commands. For more details, check [!85](https://github.com/ViRb3/wgcf/issues/85) Run the following commands: ```bash wgcf update --license-key "YOUR_LICENSE_KEY_GOES_HERE" wgcf generate ``` ### Check device status Run the following command in a terminal: ```bash wgcf status ``` ### Verify Warp/Warp+ works Connect to the WireGuard profile [generated](#generate-wireguard-profile) by this tool, then run: ```bash wgcf trace ``` If you look at the last line, it should say `warp=on` or `warp=plus`, depending on whether you have Warp or Warp+ respectively. > [!WARNING] > If you're seeing `warp=on` even after you bound a Warp+ license key, you are likely experiencing a known bug, please refer to the [Add a license key](#add-a-license-key) section. ## Development The API client code is auto-generated from the OpenAPI spec [openapi-spec.yml](openapi-spec.yml) and stored under the [openapi/](openapi/) package. Do not touch any code under that package, instead, change the spec file and regenerate the API client code. To do this, [install openapi-generator](https://openapi-generator.tech/docs/installation), then run: ```bash go generate ``` ## Notice of Non-Affiliation and Disclaimer We are not affiliated, associated, authorized, endorsed by, or in any way officially connected with Cloudflare, or any of its subsidiaries or its affiliates. The official Cloudflare website can be found at https://www.cloudflare.com/. The names Cloudflare Warp and Cloudflare as well as related names, marks, emblems and images are registered trademarks of their respective owners. ================================================ FILE: cloudflare/api.go ================================================ package cloudflare import ( "crypto/tls" "net/http" "time" "github.com/ViRb3/wgcf/v2/config" "github.com/ViRb3/wgcf/v2/openapi" "github.com/ViRb3/wgcf/v2/util" "github.com/ViRb3/wgcf/v2/wireguard" "github.com/cockroachdb/errors" ) const ( ApiUrl = "https://api.cloudflareclient.com" ApiVersion = "v0a1922" ) var ( DefaultHeaders = map[string]string{ "User-Agent": "okhttp/3.12.1", "CF-Client-Version": "a-6.3-1922", } DefaultTransport = &http.Transport{ // Match app's TLS config or API will reject us with code 403 error 1020 TLSClientConfig: &tls.Config{ MinVersion: tls.VersionTLS12, MaxVersion: tls.VersionTLS12}, ForceAttemptHTTP2: false, // From http.DefaultTransport Proxy: http.ProxyFromEnvironment, MaxIdleConns: 100, IdleConnTimeout: 90 * time.Second, TLSHandshakeTimeout: 10 * time.Second, ExpectContinueTimeout: 1 * time.Second, } ) var apiClient = MakeApiClient(nil) var apiClientAuth *openapi.APIClient func MakeApiClient(authToken *string) *openapi.APIClient { httpClient := http.Client{Transport: DefaultTransport} apiClient := openapi.NewAPIClient(&openapi.Configuration{ DefaultHeader: DefaultHeaders, UserAgent: DefaultHeaders["User-Agent"], Debug: false, Servers: []openapi.ServerConfiguration{ {URL: ApiUrl}, }, HTTPClient: &httpClient, }) if authToken != nil { apiClient.GetConfig().DefaultHeader["Authorization"] = "Bearer " + *authToken } return apiClient } func Register(publicKey *wireguard.Key, deviceModel string) (*openapi.Register200Response, error) { timestamp := util.GetTimestamp() result, _, err := apiClient.DefaultAPI. Register(nil, ApiVersion). RegisterRequest(openapi.RegisterRequest{ FcmToken: "", // not empty on actual client InstallId: "", // not empty on actual client Key: publicKey.String(), Locale: "en_US", Model: deviceModel, Tos: timestamp, Type: "Android", }).Execute() return result, errors.WithStack(err) } type SourceDevice openapi.GetSourceDevice200Response func GetSourceDevice(ctx *config.Context) (*SourceDevice, error) { result, _, err := globalClientAuth(ctx.AccessToken).DefaultAPI. GetSourceDevice(nil, ApiVersion, ctx.DeviceId). Execute() return (*SourceDevice)(result), errors.WithStack(err) } func globalClientAuth(authToken string) *openapi.APIClient { if apiClientAuth == nil { apiClientAuth = MakeApiClient(&authToken) } return apiClientAuth } type Account openapi.Account func GetAccount(ctx *config.Context) (*Account, error) { result, _, err := globalClientAuth(ctx.AccessToken).DefaultAPI. GetAccount(nil, ctx.DeviceId, ApiVersion). Execute() castResult := (*Account)(result) return castResult, errors.WithStack(err) } func UpdateLicenseKey(ctx *config.Context) (*openapi.UpdateAccount200Response, error) { result, _, err := globalClientAuth(ctx.AccessToken).DefaultAPI. UpdateAccount(nil, ctx.DeviceId, ApiVersion). UpdateAccountRequest(openapi.UpdateAccountRequest{License: ctx.LicenseKey}). Execute() if err != nil { return nil, errors.WithStack(err) } return result, nil } type BoundDevice openapi.BoundDevice func GetBoundDevices(ctx *config.Context) ([]BoundDevice, error) { result, _, err := globalClientAuth(ctx.AccessToken).DefaultAPI. GetBoundDevices(nil, ctx.DeviceId, ApiVersion). Execute() if err != nil { return nil, errors.WithStack(err) } var castResult []BoundDevice for _, device := range result { castResult = append(castResult, BoundDevice(device)) } return castResult, nil } func GetSourceBoundDevice(ctx *config.Context) (*BoundDevice, error) { result, err := GetBoundDevices(ctx) if err != nil { return nil, errors.WithStack(err) } return FindDevice(result, ctx.DeviceId) } func UpdateSourceBoundDeviceName(ctx *config.Context, targetDeviceId string, newName string) (*BoundDevice, error) { return updateSourceBoundDevice(ctx, targetDeviceId, openapi.UpdateBoundDeviceRequest{ Name: &newName, }) } func UpdateSourceBoundDeviceActive(ctx *config.Context, targetDeviceId string, active bool) (*BoundDevice, error) { return updateSourceBoundDevice(ctx, targetDeviceId, openapi.UpdateBoundDeviceRequest{ Active: &active, }) } func updateSourceBoundDevice(ctx *config.Context, targetDeviceId string, data openapi.UpdateBoundDeviceRequest) (*BoundDevice, error) { result, _, err := globalClientAuth(ctx.AccessToken).DefaultAPI. UpdateBoundDevice(nil, ctx.DeviceId, ApiVersion, targetDeviceId). UpdateBoundDeviceRequest(data). Execute() if err != nil { return nil, errors.WithStack(err) } var castResult []BoundDevice for _, device := range result { castResult = append(castResult, BoundDevice(device)) } return FindDevice(castResult, ctx.DeviceId) } func DeleteBoundDevice(ctx *config.Context, targetDeviceId string) error { if _, err := globalClientAuth(ctx.AccessToken).DefaultAPI. DeleteBoundDevice(nil, ctx.DeviceId, ApiVersion, targetDeviceId). Execute(); err != nil { return err } return nil } ================================================ FILE: cloudflare/util.go ================================================ package cloudflare import ( "github.com/cockroachdb/errors" ) func FindDevice(devices []BoundDevice, deviceId string) (*BoundDevice, error) { for _, device := range devices { if device.Id == deviceId { return &device, nil } } return nil, errors.New("device not found in list") } ================================================ FILE: cmd/generate/generate.go ================================================ package generate import ( "log" "github.com/ViRb3/wgcf/v2/cloudflare" . "github.com/ViRb3/wgcf/v2/cmd/shared" "github.com/ViRb3/wgcf/v2/config" "github.com/ViRb3/wgcf/v2/wireguard" "github.com/cockroachdb/errors" "github.com/spf13/cobra" "github.com/spf13/viper" ) var profileFile string var shortMsg = "Generates a WireGuard profile from the current Cloudflare Warp account" var Cmd = &cobra.Command{ Use: "generate", Short: shortMsg, Long: FormatMessage(shortMsg, ``), Run: func(cmd *cobra.Command, args []string) { RunCommandFatal(generateProfile) }, } func init() { Cmd.PersistentFlags().StringVarP(&profileFile, "profile", "p", "wgcf-profile.conf", "WireGuard profile file") } func generateProfile() error { if err := EnsureConfigValidAccount(); err != nil { return errors.WithStack(err) } ctx := CreateContext() thisDevice, err := cloudflare.GetSourceDevice(ctx) if err != nil { return errors.WithStack(err) } profile, err := wireguard.NewProfile(&wireguard.ProfileData{ PrivateKey: viper.GetString(config.PrivateKey), Address1: thisDevice.Config.Interface.Addresses.V4, Address2: thisDevice.Config.Interface.Addresses.V6, PublicKey: thisDevice.Config.Peers[0].PublicKey, Endpoint: thisDevice.Config.Peers[0].Endpoint.Host, }) if err != nil { return errors.WithStack(err) } if err := profile.Save(profileFile); err != nil { return errors.WithStack(err) } log.Println("Successfully generated WireGuard profile:", profileFile) return nil } ================================================ FILE: cmd/register/register.go ================================================ package register import ( "fmt" "log" "github.com/ViRb3/wgcf/v2/cloudflare" . "github.com/ViRb3/wgcf/v2/cmd/shared" "github.com/ViRb3/wgcf/v2/config" "github.com/ViRb3/wgcf/v2/wireguard" "github.com/cockroachdb/errors" "github.com/manifoldco/promptui" "github.com/spf13/cobra" "github.com/spf13/viper" ) var deviceName string var deviceModel string var existingKey string var acceptedTOS = false var shortMsg = "Registers a new Cloudflare Warp device and creates a new account, preparing it for connection" var Cmd = &cobra.Command{ Use: "register", Short: shortMsg, Long: FormatMessage(shortMsg, ``), Run: func(cmd *cobra.Command, args []string) { RunCommandFatal(registerAccount) }, } func init() { Cmd.PersistentFlags().StringVarP(&deviceName, "name", "n", "", "Device name displayed under the 1.1.1.1 app (defaults to random)") Cmd.PersistentFlags().StringVarP(&deviceModel, "model", "m", "PC", "Device model displayed under the 1.1.1.1 app") Cmd.PersistentFlags().StringVarP(&existingKey, "key", "k", "", "Base64 private key used to authenticate your device over WireGuard (defaults to random)") Cmd.PersistentFlags().BoolVar(&acceptedTOS, "accept-tos", false, "Accept Cloudflare's Terms of Service non-interactively") } func registerAccount() error { if err := EnsureNoExistingAccount(); err != nil { return errors.WithStack(err) } if err := checkTOS(); err != nil { return errors.WithStack(err) } var privateKey *wireguard.Key var err error if existingKey != "" { privateKey, err = wireguard.NewKey(existingKey) } else { privateKey, err = wireguard.NewPrivateKey() } if err != nil { return errors.WithStack(err) } device, err := cloudflare.Register(privateKey.Public(), deviceModel) if err != nil { return errors.WithStack(err) } viper.Set(config.PrivateKey, privateKey.String()) viper.Set(config.DeviceId, device.Id) viper.Set(config.AccessToken, device.Token) viper.Set(config.LicenseKey, device.Account.License) if err := viper.WriteConfig(); err != nil { return errors.WithStack(err) } ctx := CreateContext() if _, err := SetDeviceName(ctx, deviceName); err != nil { return errors.WithStack(err) } account, err := cloudflare.GetAccount(ctx) if err != nil { return errors.WithStack(err) } boundDevices, err := cloudflare.GetBoundDevices(ctx) if err != nil { return errors.WithStack(err) } PrintAccountDetails(account, boundDevices) log.Println("Successfully created Cloudflare Warp account") return nil } func checkTOS() error { if !acceptedTOS { fmt.Println("This project is in no way affiliated with Cloudflare") fmt.Println("Cloudflare's Terms of Service: https://www.cloudflare.com/application/terms/") prompt := promptui.Select{ Label: "Do you agree?", Items: []string{"Yes", "No"}, } if _, result, err := prompt.Run(); err != nil { return errors.WithStack(err) } else if result != "Yes" { return ErrTOSNotAccepted } } return nil } ================================================ FILE: cmd/root.go ================================================ package cmd import ( "errors" "log" "github.com/ViRb3/wgcf/v2/cmd/generate" "github.com/ViRb3/wgcf/v2/cmd/register" . "github.com/ViRb3/wgcf/v2/cmd/shared" "github.com/ViRb3/wgcf/v2/cmd/status" "github.com/ViRb3/wgcf/v2/cmd/trace" "github.com/ViRb3/wgcf/v2/cmd/update" "github.com/ViRb3/wgcf/v2/config" "github.com/spf13/cobra" "github.com/spf13/viper" ) var cfgFile string var RootCmd = &cobra.Command{ Use: "wgcf", Short: "WireGuard Cloudflare Warp utility", Long: FormatMessage("", ` wgcf is a utility for Cloudflare Warp that allows you to create and manage accounts, assign license keys, and generate WireGuard profiles. Project website: https://github.com/ViRb3/wgcf`), Run: func(cmd *cobra.Command, args []string) { if err := cmd.Help(); err != nil { log.Fatalf("%+v\n", err) } }, } func Execute() error { return RootCmd.Execute() } func init() { cobra.OnInitialize(initConfig) RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "wgcf-account.toml", "Configuration file") RootCmd.AddCommand(register.Cmd) RootCmd.AddCommand(update.Cmd) RootCmd.AddCommand(generate.Cmd) RootCmd.AddCommand(status.Cmd) RootCmd.AddCommand(trace.Cmd) } var unsupportedConfigError viper.UnsupportedConfigError func initConfig() { initConfigDefaults() viper.SetConfigFile(cfgFile) viper.SetEnvPrefix("WGCF") viper.AutomaticEnv() if err := viper.ReadInConfig(); errors.As(err, &unsupportedConfigError) { log.Fatal(err) } else { log.Println("Using config file:", viper.ConfigFileUsed()) } } func initConfigDefaults() { viper.SetDefault(config.DeviceId, "") viper.SetDefault(config.AccessToken, "") viper.SetDefault(config.PrivateKey, "") viper.SetDefault(config.LicenseKey, "") } ================================================ FILE: cmd/shared/shared.go ================================================ package shared import ( errors2 "errors" "fmt" "log" "slices" "strings" "github.com/ViRb3/wgcf/v2/cloudflare" "github.com/ViRb3/wgcf/v2/config" "github.com/ViRb3/wgcf/v2/util" "github.com/dustin/go-humanize" "github.com/cockroachdb/errors" "github.com/spf13/viper" ) var ErrExistingAccount = errors2.New("existing account detected, refusing to overwrite") var ErrNoAccount = errors2.New("no account detected, register one first") var ErrTOSNotAccepted = errors2.New("TOS not accepted") func RunCommandFatal(cmd func() error) { if err := cmd(); err != nil { expectedErrs := []error{ErrNoAccount, ErrExistingAccount, ErrTOSNotAccepted} if slices.ContainsFunc(expectedErrs, func(e error) bool { return errors.Is(err, e) }) { log.Fatalln(err) } else { log.Fatalf("%+v\n", err) } } } func FormatMessage(shortMessage string, longMessage string) string { if longMessage != "" { if strings.HasPrefix(longMessage, "\n") { longMessage = longMessage[1:] } longMessage = strings.Replace(longMessage, "\n", " ", -1) } if shortMessage != "" && longMessage != "" { return shortMessage + ". " + longMessage } else if shortMessage != "" { return shortMessage } else { return longMessage } } func isConfigValidAccount() bool { return viper.GetString(config.DeviceId) != "" && viper.GetString(config.AccessToken) != "" && viper.GetString(config.PrivateKey) != "" } func EnsureConfigValidAccount() error { if isConfigValidAccount() { return nil } else { return ErrNoAccount } } func EnsureNoExistingAccount() error { if isConfigValidAccount() { return ErrExistingAccount } else { return nil } } func CreateContext() *config.Context { ctx := config.Context{ DeviceId: viper.GetString(config.DeviceId), AccessToken: viper.GetString(config.AccessToken), LicenseKey: viper.GetString(config.LicenseKey), } return &ctx } func PrintAccountDetails(account *cloudflare.Account, boundDevices []cloudflare.BoundDevice) { log.Println("Printing account details:") fmt.Println() fmt.Println("================================================================") fmt.Println("Account") fmt.Println("================================================================") fmt.Printf("%-12s : %s\n", "Id", account.Id) fmt.Printf("%-12s : %s\n", "Account type", account.AccountType) fmt.Printf("%-12s : %s\n", "Created", account.Created) fmt.Printf("%-12s : %s\n", "Updated", account.Updated) fmt.Printf("%-12s : %s\n", "Premium data", humanize.Bytes(uint64(account.PremiumData))) fmt.Printf("%-12s : %s\n", "Quota", humanize.Bytes(uint64(account.Quota))) fmt.Printf("%-12s : %s\n", "Role", account.Role) fmt.Println() fmt.Println("================================================================") fmt.Println("Devices") fmt.Println("================================================================") for _, device := range boundDevices { name := "N/A" if device.Name != nil { name = *device.Name } id := device.Id if device.Id == viper.GetString(config.DeviceId) { id += " (current)" } fmt.Printf("%-9s : %s\n", "Id", id) fmt.Printf("%-9s : %s\n", "Type", device.Type) fmt.Printf("%-9s : %s\n", "Model", device.Model) fmt.Printf("%-9s : %s\n", "Name", name) fmt.Printf("%-9s : %t\n", "Active", device.Active) fmt.Printf("%-9s : %s\n", "Created", device.Created) fmt.Printf("%-9s : %s\n", "Activated", device.Activated) fmt.Printf("%-9s : %s\n", "Role", device.Role) fmt.Println() } } func SetDeviceName(ctx *config.Context, deviceName string) (*cloudflare.BoundDevice, error) { if deviceName == "" { deviceName += util.RandomHexString(3) } device, err := cloudflare.UpdateSourceBoundDeviceName(ctx, ctx.DeviceId, deviceName) if err == nil { if device.Name == nil || *device.Name != deviceName { return nil, errors.New("could not update device name") } } else if util.IsHttp500Error(err) { // server-side issue, but the operation still works } else { return nil, errors.WithStack(err) } return device, nil } ================================================ FILE: cmd/status/status.go ================================================ package status import ( "github.com/ViRb3/wgcf/v2/cloudflare" . "github.com/ViRb3/wgcf/v2/cmd/shared" "github.com/cockroachdb/errors" "github.com/spf13/cobra" ) var shortMsg = "Prints the status of the current Cloudflare Warp device" var Cmd = &cobra.Command{ Use: "status", Short: shortMsg, Long: FormatMessage(shortMsg, ``), Run: func(cmd *cobra.Command, args []string) { RunCommandFatal(status) }, } func init() { } func status() error { if err := EnsureConfigValidAccount(); err != nil { return errors.WithStack(err) } ctx := CreateContext() account, err := cloudflare.GetAccount(ctx) if err != nil { return errors.WithStack(err) } boundDevices, err := cloudflare.GetBoundDevices(ctx) if err != nil { return errors.WithStack(err) } PrintAccountDetails(account, boundDevices) return nil } ================================================ FILE: cmd/trace/trace.go ================================================ package trace import ( "fmt" "io" "log" "net/http" "strings" . "github.com/ViRb3/wgcf/v2/cmd/shared" "github.com/cockroachdb/errors" "github.com/spf13/cobra" ) var shortMsg = "Prints trace information about the current internet connection" var Cmd = &cobra.Command{ Use: "trace", Short: shortMsg, Long: FormatMessage(shortMsg, ` Useful for verifying if Warp and Warp+ are working.`), Run: func(cmd *cobra.Command, args []string) { if err := trace(); err != nil { log.Fatalf("%+v\n", err) } }, } func init() { } func trace() error { response, err := http.Get("https://cloudflare.com/cdn-cgi/trace") if err != nil { return errors.WithStack(err) } bodyBytes, err := io.ReadAll(response.Body) if err != nil { return errors.WithStack(err) } log.Println("Trace result:") fmt.Println(strings.TrimSpace(string(bodyBytes))) return nil } ================================================ FILE: cmd/update/update.go ================================================ package update import ( "log" "slices" "github.com/ViRb3/wgcf/v2/cloudflare" . "github.com/ViRb3/wgcf/v2/cmd/shared" "github.com/ViRb3/wgcf/v2/config" "github.com/cockroachdb/errors" "github.com/spf13/cobra" "github.com/spf13/viper" ) var deviceName string var licenseKey string var removeDevices []string var deactivateDevices []string var activateDevices []string var shortMsg = "Updates the current Cloudflare Warp account, preparing it for connection" var Cmd = &cobra.Command{ Use: "update", Short: shortMsg, Long: FormatMessage(shortMsg, ` If a new/different license key is provided, the current device will be bound to the new key and its parent account. Please note that there is a maximum limit of 5 active devices linked to the same account at a given time.`), Run: func(cmd *cobra.Command, args []string) { RunCommandFatal(updateAccount) }, } func init() { Cmd.PersistentFlags().StringVarP(&deviceName, "name", "n", "", "Update this device's name") Cmd.PersistentFlags().StringVarP(&licenseKey, "license-key", "l", "", "Update this device's license key") Cmd.PersistentFlags().StringSliceVar(&removeDevices, "remove", []string{}, "Remove devices by their ID (can be used multiple times)") Cmd.PersistentFlags().StringSliceVar(&deactivateDevices, "deactivate", []string{}, "Deactivate devices by their ID (can be used multiple times)") Cmd.PersistentFlags().StringSliceVar(&activateDevices, "activate", []string{}, "Activate devices by their ID (can be used multiple times)") } func updateAccount() error { if err := EnsureConfigValidAccount(); err != nil { return errors.WithStack(err) } ctx := CreateContext() if licenseKey != "" { ctx.LicenseKey = licenseKey } account, err := cloudflare.GetAccount(ctx) if err != nil { return errors.WithStack(err) } if account.License != ctx.LicenseKey { log.Println("Updated license key detected, re-binding device to new account") if _, err := cloudflare.UpdateLicenseKey(ctx); err != nil { return errors.WithStack(err) } viper.Set(config.LicenseKey, ctx.LicenseKey) if err := viper.WriteConfig(); err != nil { return errors.WithStack(err) } } boundDevice, err := cloudflare.GetSourceBoundDevice(ctx) if err != nil { return errors.WithStack(err) } if boundDevice.Name == nil || (deviceName != "" && deviceName != *boundDevice.Name) { log.Println("Setting device name") if _, err := SetDeviceName(ctx, deviceName); err != nil { return errors.WithStack(err) } } deviceActions := map[string]func() error{} for _, deviceId := range removeDevices { deviceActions[deviceId] = func() error { log.Printf("Deleting device: %s\n", deviceId) err := cloudflare.DeleteBoundDevice(ctx, deviceId) return errors.WithStack(err) } } for _, deviceId := range deactivateDevices { deviceActions[deviceId] = func() error { log.Printf("Deactivating device: %s\n", deviceId) if _, err := cloudflare.UpdateSourceBoundDeviceActive(ctx, deviceId, false); err != nil { return errors.WithStack(err) } return errors.WithStack(err) } } for _, deviceId := range activateDevices { deviceActions[deviceId] = func() error { log.Printf("Activating device: %s\n", deviceId) _, err := cloudflare.UpdateSourceBoundDeviceActive(ctx, deviceId, true) return errors.WithStack(err) } } boundDevices, err := cloudflare.GetBoundDevices(ctx) if err != nil { return errors.WithStack(err) } for deviceId, action := range deviceActions { deviceFound := slices.ContainsFunc(boundDevices, func(device cloudflare.BoundDevice) bool { return device.Id == deviceId }) if !deviceFound { return errors.Newf("device not found: %s", deviceId) } if err := action(); err != nil { return errors.WithStack(err) } } // refresh in case e.g. account type changed account, err = cloudflare.GetAccount(ctx) if err != nil { return errors.WithStack(err) } boundDevices, err = cloudflare.GetBoundDevices(ctx) if err != nil { return errors.WithStack(err) } PrintAccountDetails(account, boundDevices) log.Println("Successfully updated Cloudflare Warp account") return nil } ================================================ FILE: config/config.go ================================================ package config const ( DeviceId = "device_id" AccessToken = "access_token" PrivateKey = "private_key" LicenseKey = "license_key" ) type Context struct { DeviceId string AccessToken string PrivateKey string LicenseKey string } ================================================ FILE: go.mod ================================================ module github.com/ViRb3/wgcf/v2 go 1.24.0 toolchain go1.24.1 require ( github.com/ViRb3/wgcf/v2/openapi v0.0.0-00010101000000-000000000000 github.com/cockroachdb/errors v1.12.0 github.com/dustin/go-humanize v1.0.1 github.com/manifoldco/promptui v0.9.0 github.com/spf13/cobra v1.10.2 github.com/spf13/viper v1.21.0 golang.org/x/crypto v0.46.0 ) require ( github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-viper/mapstructure/v2 v2.4.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/sagikazarmark/locafero v0.11.0 // indirect github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect github.com/spf13/afero v1.15.0 // indirect github.com/spf13/cast v1.10.0 // indirect github.com/spf13/pflag v1.0.10 // indirect github.com/subosito/gotenv v1.6.0 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/sys v0.39.0 // indirect golang.org/x/text v0.32.0 // indirect ) replace github.com/ViRb3/wgcf/v2/openapi => ./openapi ================================================ FILE: go.sum ================================================ github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cockroachdb/errors v1.12.0 h1:d7oCs6vuIMUQRVbi6jWWWEJZahLCfJpnJSVobd1/sUo= github.com/cockroachdb/errors v1.12.0/go.mod h1:SvzfYNNBshAVbZ8wzNc/UPK3w1vf0dKDUP41ucAIf7g= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs= github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc= github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik= github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw= github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U= github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I= github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg= github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY= github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo= github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU= github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4= github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU= github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU= golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU= golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= ================================================ FILE: main.go ================================================ //go:generate openapi-generator generate -i openapi-spec.yml -g go -o openapi --additional-properties=disallowAdditionalPropertiesIfNotPresent=false package main import ( "log" "github.com/ViRb3/wgcf/v2/cmd" ) func main() { if err := cmd.Execute(); err != nil { log.Fatalf("%+v\n", err) } } ================================================ FILE: openapi/.gitignore ================================================ # Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a *.so # Folders _obj _test # Architecture specific extensions/prefixes *.[568vq] [568vq].out *.cgo1.go *.cgo2.c _cgo_defun.c _cgo_gotypes.go _cgo_export.* _testmain.go *.exe *.test *.prof ================================================ FILE: openapi/.openapi-generator/FILES ================================================ .gitignore .travis.yml README.md api/openapi.yaml api_default.go client.go configuration.go docs/Account.md docs/BoundDevice.md docs/Config.md docs/ConfigInterface.md docs/ConfigServices.md docs/DefaultAPI.md docs/Endpoint.md docs/GetClientConfig200Response.md docs/GetClientConfig200ResponseCaptivePortalInner.md docs/GetClientConfig200ResponseCaptivePortalInnerNetworksInner.md docs/GetClientConfig200ResponseDenylistInner.md docs/GetClientConfig200ResponseDenylistInnerNetworks.md docs/GetSourceDevice200Response.md docs/IPv4Network.md docs/IPv6Network.md docs/NetworkAddress.md docs/Peer.md docs/Register200Response.md docs/RegisterRequest.md docs/ResetAccountLicense200Response.md docs/SourceDevice.md docs/UpdateAccount200Response.md docs/UpdateAccountRequest.md docs/UpdateBoundDeviceRequest.md docs/UpdateSourceDevice200Response.md docs/UpdateSourceDeviceRequest.md git_push.sh go.mod go.sum model_account.go model_bound_device.go model_config.go model_config_interface.go model_config_services.go model_endpoint.go model_get_client_config_200_response.go model_get_client_config_200_response_captive_portal_inner.go model_get_client_config_200_response_captive_portal_inner_networks_inner.go model_get_client_config_200_response_denylist_inner.go model_get_client_config_200_response_denylist_inner_networks.go model_get_source_device_200_response.go model_ipv4_network.go model_ipv6_network.go model_network_address.go model_peer.go model_register_200_response.go model_register_request.go model_reset_account_license_200_response.go model_source_device.go model_update_account_200_response.go model_update_account_request.go model_update_bound_device_request.go model_update_source_device_200_response.go model_update_source_device_request.go response.go utils.go ================================================ FILE: openapi/.openapi-generator/VERSION ================================================ 7.14.0 ================================================ FILE: openapi/.openapi-generator-ignore ================================================ # OpenAPI Generator Ignore # Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): #foo/*/qux # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux # You can recursively match patterns against a directory, file or extension with a double asterisk (**): #foo/**/qux # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux # You can also negate patterns with an exclamation (!). # For example, you can ignore all files in a docs folder with the file extension .md: #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md ================================================ FILE: openapi/.travis.yml ================================================ language: go install: - go get -d -v . script: - go build -v ./ ================================================ FILE: openapi/README.md ================================================ # Go API client for openapi No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. - API version: 536 - Package version: 1.0.0 - Generator version: 7.14.0 - Build package: org.openapitools.codegen.languages.GoClientCodegen ## Installation Install the following dependencies: ```sh go get github.com/stretchr/testify/assert go get golang.org/x/net/context ``` Put the package under your project folder and add the following in import: ```go import openapi "github.com/GIT_USER_ID/GIT_REPO_ID" ``` To use a proxy, set the environment variable `HTTP_PROXY`: ```go os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") ``` ## Configuration of Server URL Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. ### Select Server Configuration For using other server than the one defined on index 0 set context value `openapi.ContextServerIndex` of type `int`. ```go ctx := context.WithValue(context.Background(), openapi.ContextServerIndex, 1) ``` ### Templated Server URL Templated server URL is formatted using default variables from configuration or from context value `openapi.ContextServerVariables` of type `map[string]string`. ```go ctx := context.WithValue(context.Background(), openapi.ContextServerVariables, map[string]string{ "basePath": "v2", }) ``` Note, enum values are always validated and all unused variables are silently ignored. ### URLs Configuration per Operation Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. An operation is uniquely identified by `"{classname}Service.{nickname}"` string. Similar rules for overriding default operation server index and variables applies by using `openapi.ContextOperationServerIndices` and `openapi.ContextOperationServerVariables` context maps. ```go ctx := context.WithValue(context.Background(), openapi.ContextOperationServerIndices, map[string]int{ "{classname}Service.{nickname}": 2, }) ctx = context.WithValue(context.Background(), openapi.ContextOperationServerVariables, map[string]map[string]string{ "{classname}Service.{nickname}": { "port": "8443", }, }) ``` ## Documentation for API Endpoints All URIs are relative to *http://localhost* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *DefaultAPI* | [**DeleteBoundDevice**](docs/DefaultAPI.md#deletebounddevice) | **Delete** /{apiVersion}/reg/{sourceDeviceId}/account/reg/{boundDeviceId} | DeleteBoundDevice *DefaultAPI* | [**GetAccount**](docs/DefaultAPI.md#getaccount) | **Get** /{apiVersion}/reg/{sourceDeviceId}/account | GetAccount *DefaultAPI* | [**GetBoundDevices**](docs/DefaultAPI.md#getbounddevices) | **Get** /{apiVersion}/reg/{sourceDeviceId}/account/devices | GetBoundDevices *DefaultAPI* | [**GetClientConfig**](docs/DefaultAPI.md#getclientconfig) | **Get** /{apiVersion}/client_config | GetClientConfig *DefaultAPI* | [**GetSourceDevice**](docs/DefaultAPI.md#getsourcedevice) | **Get** /{apiVersion}/reg/{sourceDeviceId} | GetSourceDevice *DefaultAPI* | [**Register**](docs/DefaultAPI.md#register) | **Post** /{apiVersion}/reg | Register *DefaultAPI* | [**ResetAccountLicense**](docs/DefaultAPI.md#resetaccountlicense) | **Post** /{apiVersion}/reg/{sourceDeviceId}/account/license | ResetAccountLicense *DefaultAPI* | [**UpdateAccount**](docs/DefaultAPI.md#updateaccount) | **Put** /{apiVersion}/reg/{sourceDeviceId}/account | UpdateAccount *DefaultAPI* | [**UpdateBoundDevice**](docs/DefaultAPI.md#updatebounddevice) | **Patch** /{apiVersion}/reg/{sourceDeviceId}/account/reg/{boundDeviceId} | UpdateBoundDevice *DefaultAPI* | [**UpdateSourceDevice**](docs/DefaultAPI.md#updatesourcedevice) | **Patch** /{apiVersion}/reg/{sourceDeviceId} | UpdateSourceDevice ## Documentation For Models - [Account](docs/Account.md) - [BoundDevice](docs/BoundDevice.md) - [Config](docs/Config.md) - [ConfigInterface](docs/ConfigInterface.md) - [ConfigServices](docs/ConfigServices.md) - [Endpoint](docs/Endpoint.md) - [GetClientConfig200Response](docs/GetClientConfig200Response.md) - [GetClientConfig200ResponseCaptivePortalInner](docs/GetClientConfig200ResponseCaptivePortalInner.md) - [GetClientConfig200ResponseCaptivePortalInnerNetworksInner](docs/GetClientConfig200ResponseCaptivePortalInnerNetworksInner.md) - [GetClientConfig200ResponseDenylistInner](docs/GetClientConfig200ResponseDenylistInner.md) - [GetClientConfig200ResponseDenylistInnerNetworks](docs/GetClientConfig200ResponseDenylistInnerNetworks.md) - [GetSourceDevice200Response](docs/GetSourceDevice200Response.md) - [IPv4Network](docs/IPv4Network.md) - [IPv6Network](docs/IPv6Network.md) - [NetworkAddress](docs/NetworkAddress.md) - [Peer](docs/Peer.md) - [Register200Response](docs/Register200Response.md) - [RegisterRequest](docs/RegisterRequest.md) - [ResetAccountLicense200Response](docs/ResetAccountLicense200Response.md) - [SourceDevice](docs/SourceDevice.md) - [UpdateAccount200Response](docs/UpdateAccount200Response.md) - [UpdateAccountRequest](docs/UpdateAccountRequest.md) - [UpdateBoundDeviceRequest](docs/UpdateBoundDeviceRequest.md) - [UpdateSourceDevice200Response](docs/UpdateSourceDevice200Response.md) - [UpdateSourceDeviceRequest](docs/UpdateSourceDeviceRequest.md) ## Documentation For Authorization Endpoints do not require authorization. ## Documentation for Utility Methods Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it: * `PtrBool` * `PtrInt` * `PtrInt32` * `PtrInt64` * `PtrFloat` * `PtrFloat32` * `PtrFloat64` * `PtrString` * `PtrTime` ## Author ================================================ FILE: openapi/api/openapi.yaml ================================================ openapi: 3.0.1 info: title: Cloudflare WARP API version: "536" servers: - url: / paths: /{apiVersion}/client_config: get: operationId: GetClientConfig parameters: - explode: false in: path name: apiVersion required: true schema: type: string style: simple responses: "200": content: application/json: schema: $ref: "#/components/schemas/GetClientConfig_200_Response" description: "" summary: GetClientConfig /{apiVersion}/reg: post: operationId: Register parameters: - explode: false in: path name: apiVersion required: true schema: type: string style: simple requestBody: content: application/json: schema: $ref: "#/components/schemas/Register_Request" responses: "200": content: application/json: schema: $ref: "#/components/schemas/Register_200_Response" description: "" summary: Register /{apiVersion}/reg/{sourceDeviceId}: get: operationId: GetSourceDevice parameters: - explode: false in: path name: apiVersion required: true schema: type: string style: simple - explode: false in: path name: sourceDeviceId required: true schema: type: string style: simple responses: "200": content: application/json: schema: $ref: "#/components/schemas/GetSourceDevice_200_Response" description: "" summary: GetSourceDevice patch: operationId: UpdateSourceDevice parameters: - explode: false in: path name: apiVersion required: true schema: type: string style: simple - explode: false in: path name: sourceDeviceId required: true schema: type: string style: simple requestBody: content: application/json: schema: $ref: "#/components/schemas/UpdateSourceDevice_Request" responses: "200": content: application/json: schema: $ref: "#/components/schemas/UpdateSourceDevice_200_Response" description: "" summary: UpdateSourceDevice /{apiVersion}/reg/{sourceDeviceId}/account: get: operationId: GetAccount parameters: - explode: false in: path name: sourceDeviceId required: true schema: type: string style: simple - explode: false in: path name: apiVersion required: true schema: type: string style: simple responses: "200": content: application/json: schema: $ref: "#/components/schemas/GetAccount_200_Response" description: "" summary: GetAccount put: operationId: UpdateAccount parameters: - explode: false in: path name: sourceDeviceId required: true schema: type: string style: simple - explode: false in: path name: apiVersion required: true schema: type: string style: simple requestBody: content: application/json: schema: $ref: "#/components/schemas/UpdateAccount_Request" responses: "200": content: application/json: schema: $ref: "#/components/schemas/UpdateAccount_200_Response" description: "" summary: UpdateAccount /{apiVersion}/reg/{sourceDeviceId}/account/devices: get: operationId: GetBoundDevices parameters: - explode: false in: path name: sourceDeviceId required: true schema: type: string style: simple - explode: false in: path name: apiVersion required: true schema: type: string style: simple responses: "200": content: application/json: schema: items: $ref: "#/components/schemas/GetBoundDevices_200_Response" type: array description: "" summary: GetBoundDevices /{apiVersion}/reg/{sourceDeviceId}/account/license: post: operationId: ResetAccountLicense parameters: - explode: false in: path name: sourceDeviceId required: true schema: type: string style: simple - explode: false in: path name: apiVersion required: true schema: type: string style: simple responses: "200": content: application/json: schema: $ref: "#/components/schemas/ResetAccountLicense_200_Response" description: "" summary: ResetAccountLicense /{apiVersion}/reg/{sourceDeviceId}/account/reg/{boundDeviceId}: delete: operationId: DeleteBoundDevice parameters: - explode: false in: path name: sourceDeviceId required: true schema: type: string style: simple - explode: false in: path name: apiVersion required: true schema: type: string style: simple - explode: false in: path name: boundDeviceId required: true schema: type: string style: simple responses: "204": description: "" summary: DeleteBoundDevice patch: operationId: UpdateBoundDevice parameters: - explode: false in: path name: sourceDeviceId required: true schema: type: string style: simple - explode: false in: path name: apiVersion required: true schema: type: string style: simple - explode: false in: path name: boundDeviceId required: true schema: type: string style: simple requestBody: content: application/json: schema: $ref: "#/components/schemas/UpdateBoundDevice_Request" responses: "200": content: application/json: schema: items: $ref: "#/components/schemas/UpdateBoundDevice_200_Response" type: array description: "" summary: UpdateBoundDevice components: schemas: Account: example: license: license referral_count: 5.962133916683182 account_type: account_type role: role referral_renewal_countdown: 5.637376656633329 created: created quota: 1.4658129805029452 warp_plus: true usage: 2.3021358869347655 premium_data: 6.027456183070403 id: id updated: updated properties: account_type: type: string created: type: string id: type: string license: type: string premium_data: type: number quota: type: number referral_count: type: number referral_renewal_countdown: type: number role: type: string updated: type: string warp_plus: type: boolean usage: type: number required: - account_type - created - id - license - premium_data - quota - referral_count - referral_renewal_countdown - role - updated - warp_plus type: object BoundDevice: properties: activated: type: string active: type: boolean created: type: string id: type: string model: type: string name: type: string role: type: string type: type: string required: - activated - active - created - id - model - role - type type: object NetworkAddress: example: v6: v6 v4: v4 properties: v4: type: string v6: type: string required: - v4 - v6 type: object Endpoint: example: v6: v6 host: host v4: v4 properties: host: type: string v4: type: string v6: type: string required: - host - v4 - v6 type: object Peer: example: public_key: public_key endpoint: v6: v6 host: host v4: v4 properties: endpoint: $ref: "#/components/schemas/Endpoint" public_key: type: string required: - endpoint - public_key type: object Config: example: peers: - public_key: public_key endpoint: v6: v6 host: host v4: v4 - public_key: public_key endpoint: v6: v6 host: host v4: v4 services: http_proxy: http_proxy interface: addresses: v6: v6 v4: v4 client_id: client_id properties: client_id: type: string interface: $ref: "#/components/schemas/Config_interface" peers: items: $ref: "#/components/schemas/Peer" type: array services: $ref: "#/components/schemas/Config_services" required: - client_id - interface - peers - services type: object SourceDevice: properties: created: type: string enabled: type: boolean fcm_token: type: string id: type: string install_id: type: string key: type: string locale: type: string model: type: string name: type: string place: type: number tos: type: string type: type: string updated: type: string waitlist_enabled: type: boolean warp_enabled: type: boolean required: - created - enabled - fcm_token - id - install_id - key - locale - model - name - place - tos - type - updated - waitlist_enabled - warp_enabled type: object IPv4Network: example: address: address netmask: netmask properties: address: type: string netmask: type: string required: - address - netmask type: object IPv6Network: example: address: address prefix: 0.8008281904610115 properties: address: type: string prefix: type: number required: - address - prefix type: object GetAccount_200_Response: $ref: "#/components/schemas/Account" GetBoundDevices_200_Response: $ref: "#/components/schemas/BoundDevice" GetClientConfig_200_Response: example: captive_portal: - name: name networks: - address: address - address: address - name: name networks: - address: address - address: address denylist: - visible: true name: name networks: v6: - address: address prefix: 0.8008281904610115 - address: address prefix: 0.8008281904610115 v4: - address: address netmask: netmask - address: address netmask: netmask android-packages: - android-packages - android-packages - visible: true name: name networks: v6: - address: address prefix: 0.8008281904610115 - address: address prefix: 0.8008281904610115 v4: - address: address netmask: netmask - address: address netmask: netmask android-packages: - android-packages - android-packages referral_reward_bytes: 1.4658129805029452 premium_data_bytes: 6.027456183070403 properties: captive_portal: items: $ref: "#/components/schemas/GetClientConfig_200_Response_captive_portal_inner" type: array denylist: items: $ref: "#/components/schemas/GetClientConfig_200_Response_denylist_inner" type: array premium_data_bytes: type: number referral_reward_bytes: type: number required: - captive_portal - denylist - premium_data_bytes - referral_reward_bytes type: object GetSourceDevice_200_Response: allOf: - $ref: "#/components/schemas/SourceDevice" - properties: account: $ref: "#/components/schemas/Account" config: $ref: "#/components/schemas/Config" required: - account - config type: object example: created: created locale: locale type: type enabled: true waitlist_enabled: true install_id: install_id warp_enabled: true fcm_token: fcm_token name: name tos: tos model: model id: id place: 0.8008281904610115 updated: updated config: peers: - public_key: public_key endpoint: v6: v6 host: host v4: v4 - public_key: public_key endpoint: v6: v6 host: host v4: v4 services: http_proxy: http_proxy interface: addresses: v6: v6 v4: v4 client_id: client_id key: key account: license: license referral_count: 5.962133916683182 account_type: account_type role: role referral_renewal_countdown: 5.637376656633329 created: created quota: 1.4658129805029452 warp_plus: true usage: 2.3021358869347655 premium_data: 6.027456183070403 id: id updated: updated Register_200_Response: allOf: - $ref: "#/components/schemas/SourceDevice" - properties: account: $ref: "#/components/schemas/Account" config: $ref: "#/components/schemas/Config" token: type: string required: - account - config - token type: object example: created: created locale: locale type: type enabled: true token: token waitlist_enabled: true install_id: install_id warp_enabled: true fcm_token: fcm_token name: name tos: tos model: model id: id place: 0.8008281904610115 updated: updated config: peers: - public_key: public_key endpoint: v6: v6 host: host v4: v4 - public_key: public_key endpoint: v6: v6 host: host v4: v4 services: http_proxy: http_proxy interface: addresses: v6: v6 v4: v4 client_id: client_id key: key account: license: license referral_count: 5.962133916683182 account_type: account_type role: role referral_renewal_countdown: 5.637376656633329 created: created quota: 1.4658129805029452 warp_plus: true usage: 2.3021358869347655 premium_data: 6.027456183070403 id: id updated: updated Register_Request: properties: fcm_token: type: string install_id: type: string key: type: string locale: type: string model: type: string tos: type: string type: type: string required: - fcm_token - install_id - key - locale - model - tos - type type: object ResetAccountLicense_200_Response: example: license: license properties: license: type: string required: - license type: object UpdateAccount_200_Response: example: referral_count: 1.4658129805029452 role: role referral_renewal_countdown: 5.962133916683182 created: created quota: 6.027456183070403 warp_plus: true premium_data: 0.8008281904610115 id: id updated: updated properties: created: type: string id: type: string premium_data: type: number quota: type: number referral_count: type: number referral_renewal_countdown: type: number role: type: string updated: type: string warp_plus: type: boolean required: - created - id - premium_data - quota - referral_count - referral_renewal_countdown - role - updated - warp_plus type: object UpdateAccount_Request: properties: license: type: string required: - license type: object UpdateBoundDevice_200_Response: $ref: "#/components/schemas/BoundDevice" UpdateBoundDevice_Request: properties: active: type: boolean name: type: string type: object UpdateSourceDevice_200_Response: allOf: - $ref: "#/components/schemas/SourceDevice" - properties: account: $ref: "#/components/schemas/Account" config: $ref: "#/components/schemas/Config" required: - account - config type: object example: created: created locale: locale type: type enabled: true waitlist_enabled: true install_id: install_id warp_enabled: true fcm_token: fcm_token name: name tos: tos model: model id: id place: 0.8008281904610115 updated: updated config: peers: - public_key: public_key endpoint: v6: v6 host: host v4: v4 - public_key: public_key endpoint: v6: v6 host: host v4: v4 services: http_proxy: http_proxy interface: addresses: v6: v6 v4: v4 client_id: client_id key: key account: license: license referral_count: 5.962133916683182 account_type: account_type role: role referral_renewal_countdown: 5.637376656633329 created: created quota: 1.4658129805029452 warp_plus: true usage: 2.3021358869347655 premium_data: 6.027456183070403 id: id updated: updated UpdateSourceDevice_Request: properties: key: type: string required: - key type: object Config_interface: example: addresses: v6: v6 v4: v4 properties: addresses: $ref: "#/components/schemas/NetworkAddress" required: - addresses type: object Config_services: example: http_proxy: http_proxy properties: http_proxy: type: string required: - http_proxy type: object GetClientConfig_200_Response_captive_portal_inner_networks_inner: example: address: address properties: address: type: string required: - address type: object GetClientConfig_200_Response_captive_portal_inner: example: name: name networks: - address: address - address: address properties: name: type: string networks: items: $ref: "#/components/schemas/GetClientConfig_200_Response_captive_portal_inner_networks_inner" type: array required: - name - networks type: object GetClientConfig_200_Response_denylist_inner_networks: example: v6: - address: address prefix: 0.8008281904610115 - address: address prefix: 0.8008281904610115 v4: - address: address netmask: netmask - address: address netmask: netmask properties: v4: items: $ref: "#/components/schemas/IPv4Network" type: array v6: items: $ref: "#/components/schemas/IPv6Network" type: array required: - v4 - v6 type: object GetClientConfig_200_Response_denylist_inner: example: visible: true name: name networks: v6: - address: address prefix: 0.8008281904610115 - address: address prefix: 0.8008281904610115 v4: - address: address netmask: netmask - address: address netmask: netmask android-packages: - android-packages - android-packages properties: android-packages: items: type: string type: array name: type: string networks: $ref: "#/components/schemas/GetClientConfig_200_Response_denylist_inner_networks" visible: type: boolean required: - name - visible type: object ================================================ FILE: openapi/api_default.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "bytes" "context" "io" "net/http" "net/url" "strings" ) // DefaultAPIService DefaultAPI service type DefaultAPIService service type ApiDeleteBoundDeviceRequest struct { ctx context.Context ApiService *DefaultAPIService sourceDeviceId string apiVersion string boundDeviceId string } func (r ApiDeleteBoundDeviceRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteBoundDeviceExecute(r) } /* DeleteBoundDevice DeleteBoundDevice @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param sourceDeviceId @param apiVersion @param boundDeviceId @return ApiDeleteBoundDeviceRequest */ func (a *DefaultAPIService) DeleteBoundDevice(ctx context.Context, sourceDeviceId string, apiVersion string, boundDeviceId string) ApiDeleteBoundDeviceRequest { return ApiDeleteBoundDeviceRequest{ ApiService: a, ctx: ctx, sourceDeviceId: sourceDeviceId, apiVersion: apiVersion, boundDeviceId: boundDeviceId, } } // Execute executes the request func (a *DefaultAPIService) DeleteBoundDeviceExecute(r ApiDeleteBoundDeviceRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteBoundDevice") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/{apiVersion}/reg/{sourceDeviceId}/account/reg/{boundDeviceId}" localVarPath = strings.Replace(localVarPath, "{"+"sourceDeviceId"+"}", url.PathEscape(parameterValueToString(r.sourceDeviceId, "sourceDeviceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"apiVersion"+"}", url.PathEscape(parameterValueToString(r.apiVersion, "apiVersion")), -1) localVarPath = strings.Replace(localVarPath, "{"+"boundDeviceId"+"}", url.PathEscape(parameterValueToString(r.boundDeviceId, "boundDeviceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) if localVarHTTPContentType != "" { localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header localVarHTTPHeaderAccepts := []string{} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarHTTPResponse, newErr } return localVarHTTPResponse, nil } type ApiGetAccountRequest struct { ctx context.Context ApiService *DefaultAPIService sourceDeviceId string apiVersion string } func (r ApiGetAccountRequest) Execute() (*Account, *http.Response, error) { return r.ApiService.GetAccountExecute(r) } /* GetAccount GetAccount @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param sourceDeviceId @param apiVersion @return ApiGetAccountRequest */ func (a *DefaultAPIService) GetAccount(ctx context.Context, sourceDeviceId string, apiVersion string) ApiGetAccountRequest { return ApiGetAccountRequest{ ApiService: a, ctx: ctx, sourceDeviceId: sourceDeviceId, apiVersion: apiVersion, } } // Execute executes the request // @return Account func (a *DefaultAPIService) GetAccountExecute(r ApiGetAccountRequest) (*Account, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile localVarReturnValue *Account ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetAccount") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/{apiVersion}/reg/{sourceDeviceId}/account" localVarPath = strings.Replace(localVarPath, "{"+"sourceDeviceId"+"}", url.PathEscape(parameterValueToString(r.sourceDeviceId, "sourceDeviceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"apiVersion"+"}", url.PathEscape(parameterValueToString(r.apiVersion, "apiVersion")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) if localVarHTTPContentType != "" { localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr } return localVarReturnValue, localVarHTTPResponse, nil } type ApiGetBoundDevicesRequest struct { ctx context.Context ApiService *DefaultAPIService sourceDeviceId string apiVersion string } func (r ApiGetBoundDevicesRequest) Execute() ([]BoundDevice, *http.Response, error) { return r.ApiService.GetBoundDevicesExecute(r) } /* GetBoundDevices GetBoundDevices @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param sourceDeviceId @param apiVersion @return ApiGetBoundDevicesRequest */ func (a *DefaultAPIService) GetBoundDevices(ctx context.Context, sourceDeviceId string, apiVersion string) ApiGetBoundDevicesRequest { return ApiGetBoundDevicesRequest{ ApiService: a, ctx: ctx, sourceDeviceId: sourceDeviceId, apiVersion: apiVersion, } } // Execute executes the request // @return []BoundDevice func (a *DefaultAPIService) GetBoundDevicesExecute(r ApiGetBoundDevicesRequest) ([]BoundDevice, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile localVarReturnValue []BoundDevice ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetBoundDevices") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/{apiVersion}/reg/{sourceDeviceId}/account/devices" localVarPath = strings.Replace(localVarPath, "{"+"sourceDeviceId"+"}", url.PathEscape(parameterValueToString(r.sourceDeviceId, "sourceDeviceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"apiVersion"+"}", url.PathEscape(parameterValueToString(r.apiVersion, "apiVersion")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) if localVarHTTPContentType != "" { localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr } return localVarReturnValue, localVarHTTPResponse, nil } type ApiGetClientConfigRequest struct { ctx context.Context ApiService *DefaultAPIService apiVersion string } func (r ApiGetClientConfigRequest) Execute() (*GetClientConfig200Response, *http.Response, error) { return r.ApiService.GetClientConfigExecute(r) } /* GetClientConfig GetClientConfig @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param apiVersion @return ApiGetClientConfigRequest */ func (a *DefaultAPIService) GetClientConfig(ctx context.Context, apiVersion string) ApiGetClientConfigRequest { return ApiGetClientConfigRequest{ ApiService: a, ctx: ctx, apiVersion: apiVersion, } } // Execute executes the request // @return GetClientConfig200Response func (a *DefaultAPIService) GetClientConfigExecute(r ApiGetClientConfigRequest) (*GetClientConfig200Response, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile localVarReturnValue *GetClientConfig200Response ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetClientConfig") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/{apiVersion}/client_config" localVarPath = strings.Replace(localVarPath, "{"+"apiVersion"+"}", url.PathEscape(parameterValueToString(r.apiVersion, "apiVersion")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) if localVarHTTPContentType != "" { localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr } return localVarReturnValue, localVarHTTPResponse, nil } type ApiGetSourceDeviceRequest struct { ctx context.Context ApiService *DefaultAPIService apiVersion string sourceDeviceId string } func (r ApiGetSourceDeviceRequest) Execute() (*GetSourceDevice200Response, *http.Response, error) { return r.ApiService.GetSourceDeviceExecute(r) } /* GetSourceDevice GetSourceDevice @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param apiVersion @param sourceDeviceId @return ApiGetSourceDeviceRequest */ func (a *DefaultAPIService) GetSourceDevice(ctx context.Context, apiVersion string, sourceDeviceId string) ApiGetSourceDeviceRequest { return ApiGetSourceDeviceRequest{ ApiService: a, ctx: ctx, apiVersion: apiVersion, sourceDeviceId: sourceDeviceId, } } // Execute executes the request // @return GetSourceDevice200Response func (a *DefaultAPIService) GetSourceDeviceExecute(r ApiGetSourceDeviceRequest) (*GetSourceDevice200Response, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile localVarReturnValue *GetSourceDevice200Response ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetSourceDevice") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/{apiVersion}/reg/{sourceDeviceId}" localVarPath = strings.Replace(localVarPath, "{"+"apiVersion"+"}", url.PathEscape(parameterValueToString(r.apiVersion, "apiVersion")), -1) localVarPath = strings.Replace(localVarPath, "{"+"sourceDeviceId"+"}", url.PathEscape(parameterValueToString(r.sourceDeviceId, "sourceDeviceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) if localVarHTTPContentType != "" { localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr } return localVarReturnValue, localVarHTTPResponse, nil } type ApiRegisterRequest struct { ctx context.Context ApiService *DefaultAPIService apiVersion string registerRequest *RegisterRequest } func (r ApiRegisterRequest) RegisterRequest(registerRequest RegisterRequest) ApiRegisterRequest { r.registerRequest = ®isterRequest return r } func (r ApiRegisterRequest) Execute() (*Register200Response, *http.Response, error) { return r.ApiService.RegisterExecute(r) } /* Register Register @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param apiVersion @return ApiRegisterRequest */ func (a *DefaultAPIService) Register(ctx context.Context, apiVersion string) ApiRegisterRequest { return ApiRegisterRequest{ ApiService: a, ctx: ctx, apiVersion: apiVersion, } } // Execute executes the request // @return Register200Response func (a *DefaultAPIService) RegisterExecute(r ApiRegisterRequest) (*Register200Response, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile localVarReturnValue *Register200Response ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.Register") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/{apiVersion}/reg" localVarPath = strings.Replace(localVarPath, "{"+"apiVersion"+"}", url.PathEscape(parameterValueToString(r.apiVersion, "apiVersion")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) if localVarHTTPContentType != "" { localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = r.registerRequest req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr } return localVarReturnValue, localVarHTTPResponse, nil } type ApiResetAccountLicenseRequest struct { ctx context.Context ApiService *DefaultAPIService sourceDeviceId string apiVersion string } func (r ApiResetAccountLicenseRequest) Execute() (*ResetAccountLicense200Response, *http.Response, error) { return r.ApiService.ResetAccountLicenseExecute(r) } /* ResetAccountLicense ResetAccountLicense @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param sourceDeviceId @param apiVersion @return ApiResetAccountLicenseRequest */ func (a *DefaultAPIService) ResetAccountLicense(ctx context.Context, sourceDeviceId string, apiVersion string) ApiResetAccountLicenseRequest { return ApiResetAccountLicenseRequest{ ApiService: a, ctx: ctx, sourceDeviceId: sourceDeviceId, apiVersion: apiVersion, } } // Execute executes the request // @return ResetAccountLicense200Response func (a *DefaultAPIService) ResetAccountLicenseExecute(r ApiResetAccountLicenseRequest) (*ResetAccountLicense200Response, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile localVarReturnValue *ResetAccountLicense200Response ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ResetAccountLicense") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/{apiVersion}/reg/{sourceDeviceId}/account/license" localVarPath = strings.Replace(localVarPath, "{"+"sourceDeviceId"+"}", url.PathEscape(parameterValueToString(r.sourceDeviceId, "sourceDeviceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"apiVersion"+"}", url.PathEscape(parameterValueToString(r.apiVersion, "apiVersion")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) if localVarHTTPContentType != "" { localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr } return localVarReturnValue, localVarHTTPResponse, nil } type ApiUpdateAccountRequest struct { ctx context.Context ApiService *DefaultAPIService sourceDeviceId string apiVersion string updateAccountRequest *UpdateAccountRequest } func (r ApiUpdateAccountRequest) UpdateAccountRequest(updateAccountRequest UpdateAccountRequest) ApiUpdateAccountRequest { r.updateAccountRequest = &updateAccountRequest return r } func (r ApiUpdateAccountRequest) Execute() (*UpdateAccount200Response, *http.Response, error) { return r.ApiService.UpdateAccountExecute(r) } /* UpdateAccount UpdateAccount @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param sourceDeviceId @param apiVersion @return ApiUpdateAccountRequest */ func (a *DefaultAPIService) UpdateAccount(ctx context.Context, sourceDeviceId string, apiVersion string) ApiUpdateAccountRequest { return ApiUpdateAccountRequest{ ApiService: a, ctx: ctx, sourceDeviceId: sourceDeviceId, apiVersion: apiVersion, } } // Execute executes the request // @return UpdateAccount200Response func (a *DefaultAPIService) UpdateAccountExecute(r ApiUpdateAccountRequest) (*UpdateAccount200Response, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile localVarReturnValue *UpdateAccount200Response ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateAccount") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/{apiVersion}/reg/{sourceDeviceId}/account" localVarPath = strings.Replace(localVarPath, "{"+"sourceDeviceId"+"}", url.PathEscape(parameterValueToString(r.sourceDeviceId, "sourceDeviceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"apiVersion"+"}", url.PathEscape(parameterValueToString(r.apiVersion, "apiVersion")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) if localVarHTTPContentType != "" { localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = r.updateAccountRequest req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr } return localVarReturnValue, localVarHTTPResponse, nil } type ApiUpdateBoundDeviceRequest struct { ctx context.Context ApiService *DefaultAPIService sourceDeviceId string apiVersion string boundDeviceId string updateBoundDeviceRequest *UpdateBoundDeviceRequest } func (r ApiUpdateBoundDeviceRequest) UpdateBoundDeviceRequest(updateBoundDeviceRequest UpdateBoundDeviceRequest) ApiUpdateBoundDeviceRequest { r.updateBoundDeviceRequest = &updateBoundDeviceRequest return r } func (r ApiUpdateBoundDeviceRequest) Execute() ([]BoundDevice, *http.Response, error) { return r.ApiService.UpdateBoundDeviceExecute(r) } /* UpdateBoundDevice UpdateBoundDevice @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param sourceDeviceId @param apiVersion @param boundDeviceId @return ApiUpdateBoundDeviceRequest */ func (a *DefaultAPIService) UpdateBoundDevice(ctx context.Context, sourceDeviceId string, apiVersion string, boundDeviceId string) ApiUpdateBoundDeviceRequest { return ApiUpdateBoundDeviceRequest{ ApiService: a, ctx: ctx, sourceDeviceId: sourceDeviceId, apiVersion: apiVersion, boundDeviceId: boundDeviceId, } } // Execute executes the request // @return []BoundDevice func (a *DefaultAPIService) UpdateBoundDeviceExecute(r ApiUpdateBoundDeviceRequest) ([]BoundDevice, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile localVarReturnValue []BoundDevice ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateBoundDevice") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/{apiVersion}/reg/{sourceDeviceId}/account/reg/{boundDeviceId}" localVarPath = strings.Replace(localVarPath, "{"+"sourceDeviceId"+"}", url.PathEscape(parameterValueToString(r.sourceDeviceId, "sourceDeviceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"apiVersion"+"}", url.PathEscape(parameterValueToString(r.apiVersion, "apiVersion")), -1) localVarPath = strings.Replace(localVarPath, "{"+"boundDeviceId"+"}", url.PathEscape(parameterValueToString(r.boundDeviceId, "boundDeviceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) if localVarHTTPContentType != "" { localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = r.updateBoundDeviceRequest req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr } return localVarReturnValue, localVarHTTPResponse, nil } type ApiUpdateSourceDeviceRequest struct { ctx context.Context ApiService *DefaultAPIService apiVersion string sourceDeviceId string updateSourceDeviceRequest *UpdateSourceDeviceRequest } func (r ApiUpdateSourceDeviceRequest) UpdateSourceDeviceRequest(updateSourceDeviceRequest UpdateSourceDeviceRequest) ApiUpdateSourceDeviceRequest { r.updateSourceDeviceRequest = &updateSourceDeviceRequest return r } func (r ApiUpdateSourceDeviceRequest) Execute() (*UpdateSourceDevice200Response, *http.Response, error) { return r.ApiService.UpdateSourceDeviceExecute(r) } /* UpdateSourceDevice UpdateSourceDevice @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param apiVersion @param sourceDeviceId @return ApiUpdateSourceDeviceRequest */ func (a *DefaultAPIService) UpdateSourceDevice(ctx context.Context, apiVersion string, sourceDeviceId string) ApiUpdateSourceDeviceRequest { return ApiUpdateSourceDeviceRequest{ ApiService: a, ctx: ctx, apiVersion: apiVersion, sourceDeviceId: sourceDeviceId, } } // Execute executes the request // @return UpdateSourceDevice200Response func (a *DefaultAPIService) UpdateSourceDeviceExecute(r ApiUpdateSourceDeviceRequest) (*UpdateSourceDevice200Response, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile localVarReturnValue *UpdateSourceDevice200Response ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateSourceDevice") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/{apiVersion}/reg/{sourceDeviceId}" localVarPath = strings.Replace(localVarPath, "{"+"apiVersion"+"}", url.PathEscape(parameterValueToString(r.apiVersion, "apiVersion")), -1) localVarPath = strings.Replace(localVarPath, "{"+"sourceDeviceId"+"}", url.PathEscape(parameterValueToString(r.sourceDeviceId, "sourceDeviceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) if localVarHTTPContentType != "" { localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = r.updateSourceDeviceRequest req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr } return localVarReturnValue, localVarHTTPResponse, nil } ================================================ FILE: openapi/client.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "bytes" "context" "encoding/json" "encoding/xml" "errors" "fmt" "io" "log" "mime/multipart" "net/http" "net/http/httputil" "net/url" "os" "path/filepath" "reflect" "regexp" "strconv" "strings" "time" "unicode/utf8" ) var ( JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) ) // APIClient manages communication with the Cloudflare WARP API API v536 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *Configuration common service // Reuse a single struct instead of allocating one for each service on the heap. // API Services DefaultAPI *DefaultAPIService } type service struct { client *APIClient } // NewAPIClient creates a new API client. Requires a userAgent string describing your application. // optionally a custom http.Client to allow for advanced features such as caching. func NewAPIClient(cfg *Configuration) *APIClient { if cfg.HTTPClient == nil { cfg.HTTPClient = http.DefaultClient } c := &APIClient{} c.cfg = cfg c.common.client = c // API Services c.DefaultAPI = (*DefaultAPIService)(&c.common) return c } func atoi(in string) (int, error) { return strconv.Atoi(in) } // selectHeaderContentType select a content type from the available list. func selectHeaderContentType(contentTypes []string) string { if len(contentTypes) == 0 { return "" } if contains(contentTypes, "application/json") { return "application/json" } return contentTypes[0] // use the first content type specified in 'consumes' } // selectHeaderAccept join all accept types and return func selectHeaderAccept(accepts []string) string { if len(accepts) == 0 { return "" } if contains(accepts, "application/json") { return "application/json" } return strings.Join(accepts, ",") } // contains is a case insensitive match, finding needle in a haystack func contains(haystack []string, needle string) bool { for _, a := range haystack { if strings.EqualFold(a, needle) { return true } } return false } // Verify optional parameters are of the correct type. func typeCheckParameter(obj interface{}, expected string, name string) error { // Make sure there is an object. if obj == nil { return nil } // Check the type is as expected. if reflect.TypeOf(obj).String() != expected { return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) } return nil } func parameterValueToString( obj interface{}, key string ) string { if reflect.TypeOf(obj).Kind() != reflect.Ptr { if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) } return fmt.Sprintf("%v", obj) } var param,ok = obj.(MappedNullable) if !ok { return "" } dataMap,err := param.ToMap() if err != nil { return "" } return fmt.Sprintf("%v", dataMap[key]) } // parameterAddToHeaderOrQuery adds the provided object to the request header or url query // supporting deep object syntax func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { var v = reflect.ValueOf(obj) var value = "" if v == reflect.ValueOf(nil) { value = "null" } else { switch v.Kind() { case reflect.Invalid: value = "invalid" case reflect.Struct: if t,ok := obj.(MappedNullable); ok { dataMap,err := t.ToMap() if err != nil { return } parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) return } if t, ok := obj.(time.Time); ok { parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) return } value = v.Type().String() + " value" case reflect.Slice: var indValue = reflect.ValueOf(obj) if indValue == reflect.ValueOf(nil) { return } var lenIndValue = indValue.Len() for i:=0;i 0 || (len(formFiles) > 0) { if body != nil { return nil, errors.New("Cannot specify postBody and multipart form at the same time.") } body = &bytes.Buffer{} w := multipart.NewWriter(body) for k, v := range formParams { for _, iv := range v { if strings.HasPrefix(k, "@") { // file err = addFile(w, k[1:], iv) if err != nil { return nil, err } } else { // form value w.WriteField(k, iv) } } } for _, formFile := range formFiles { if len(formFile.fileBytes) > 0 && formFile.fileName != "" { w.Boundary() part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) if err != nil { return nil, err } _, err = part.Write(formFile.fileBytes) if err != nil { return nil, err } } } // Set the Boundary in the Content-Type headerParams["Content-Type"] = w.FormDataContentType() // Set Content-Length headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) w.Close() } if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { if body != nil { return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") } body = &bytes.Buffer{} body.WriteString(formParams.Encode()) // Set Content-Length headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) } // Setup path and query parameters url, err := url.Parse(path) if err != nil { return nil, err } // Override request host, if applicable if c.cfg.Host != "" { url.Host = c.cfg.Host } // Override request scheme, if applicable if c.cfg.Scheme != "" { url.Scheme = c.cfg.Scheme } // Adding Query Param query := url.Query() for k, v := range queryParams { for _, iv := range v { query.Add(k, iv) } } // Encode the parameters. url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { pieces := strings.Split(s, "=") pieces[0] = queryDescape.Replace(pieces[0]) return strings.Join(pieces, "=") }) // Generate a new request if body != nil { localVarRequest, err = http.NewRequest(method, url.String(), body) } else { localVarRequest, err = http.NewRequest(method, url.String(), nil) } if err != nil { return nil, err } // add header parameters, if any if len(headerParams) > 0 { headers := http.Header{} for h, v := range headerParams { headers[h] = []string{v} } localVarRequest.Header = headers } // Add the user agent to the request. localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) if ctx != nil { // add context to the request localVarRequest = localVarRequest.WithContext(ctx) // Walk through any authentication. } for header, value := range c.cfg.DefaultHeader { localVarRequest.Header.Add(header, value) } return localVarRequest, nil } func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { if len(b) == 0 { return nil } if s, ok := v.(*string); ok { *s = string(b) return nil } if f, ok := v.(*os.File); ok { f, err = os.CreateTemp("", "HttpClientFile") if err != nil { return } _, err = f.Write(b) if err != nil { return } _, err = f.Seek(0, io.SeekStart) return } if f, ok := v.(**os.File); ok { *f, err = os.CreateTemp("", "HttpClientFile") if err != nil { return } _, err = (*f).Write(b) if err != nil { return } _, err = (*f).Seek(0, io.SeekStart) return } if XmlCheck.MatchString(contentType) { if err = xml.Unmarshal(b, v); err != nil { return err } return nil } if JsonCheck.MatchString(contentType) { if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined if err = unmarshalObj.UnmarshalJSON(b); err != nil { return err } } else { return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") } } else if err = json.Unmarshal(b, v); err != nil { // simple model return err } return nil } return errors.New("undefined response type") } // Add a file to the multipart request func addFile(w *multipart.Writer, fieldName, path string) error { file, err := os.Open(filepath.Clean(path)) if err != nil { return err } err = file.Close() if err != nil { return err } part, err := w.CreateFormFile(fieldName, filepath.Base(path)) if err != nil { return err } _, err = io.Copy(part, file) return err } // Set request body from an interface{} func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { if bodyBuf == nil { bodyBuf = &bytes.Buffer{} } if reader, ok := body.(io.Reader); ok { _, err = bodyBuf.ReadFrom(reader) } else if fp, ok := body.(*os.File); ok { _, err = bodyBuf.ReadFrom(fp) } else if b, ok := body.([]byte); ok { _, err = bodyBuf.Write(b) } else if s, ok := body.(string); ok { _, err = bodyBuf.WriteString(s) } else if s, ok := body.(*string); ok { _, err = bodyBuf.WriteString(*s) } else if JsonCheck.MatchString(contentType) { err = json.NewEncoder(bodyBuf).Encode(body) } else if XmlCheck.MatchString(contentType) { var bs []byte bs, err = xml.Marshal(body) if err == nil { bodyBuf.Write(bs) } } if err != nil { return nil, err } if bodyBuf.Len() == 0 { err = fmt.Errorf("invalid body type %s\n", contentType) return nil, err } return bodyBuf, nil } // detectContentType method is used to figure out `Request.Body` content type for request header func detectContentType(body interface{}) string { contentType := "text/plain; charset=utf-8" kind := reflect.TypeOf(body).Kind() switch kind { case reflect.Struct, reflect.Map, reflect.Ptr: contentType = "application/json; charset=utf-8" case reflect.String: contentType = "text/plain; charset=utf-8" default: if b, ok := body.([]byte); ok { contentType = http.DetectContentType(b) } else if kind == reflect.Slice { contentType = "application/json; charset=utf-8" } } return contentType } // Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go type cacheControl map[string]string func parseCacheControl(headers http.Header) cacheControl { cc := cacheControl{} ccHeader := headers.Get("Cache-Control") for _, part := range strings.Split(ccHeader, ",") { part = strings.Trim(part, " ") if part == "" { continue } if strings.ContainsRune(part, '=') { keyval := strings.Split(part, "=") cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") } else { cc[part] = "" } } return cc } // CacheExpires helper function to determine remaining time before repeating a request. func CacheExpires(r *http.Response) time.Time { // Figure out when the cache expires. var expires time.Time now, err := time.Parse(time.RFC1123, r.Header.Get("date")) if err != nil { return time.Now() } respCacheControl := parseCacheControl(r.Header) if maxAge, ok := respCacheControl["max-age"]; ok { lifetime, err := time.ParseDuration(maxAge + "s") if err != nil { expires = now } else { expires = now.Add(lifetime) } } else { expiresHeader := r.Header.Get("Expires") if expiresHeader != "" { expires, err = time.Parse(time.RFC1123, expiresHeader) if err != nil { expires = now } } } return expires } func strlen(s string) int { return utf8.RuneCountInString(s) } // GenericOpenAPIError Provides access to the body, error and model on returned errors. type GenericOpenAPIError struct { body []byte error string model interface{} } // Error returns non-empty string if there was an error. func (e GenericOpenAPIError) Error() string { return e.error } // Body returns the raw bytes of the response func (e GenericOpenAPIError) Body() []byte { return e.body } // Model returns the unpacked model of the error func (e GenericOpenAPIError) Model() interface{} { return e.model } // format error message using title and detail when model implements rfc7807 func formatErrorMessage(status string, v interface{}) string { str := "" metaValue := reflect.ValueOf(v).Elem() if metaValue.Kind() == reflect.Struct { field := metaValue.FieldByName("Title") if field != (reflect.Value{}) { str = fmt.Sprintf("%s", field.Interface()) } field = metaValue.FieldByName("Detail") if field != (reflect.Value{}) { str = fmt.Sprintf("%s (%s)", str, field.Interface()) } } return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) } ================================================ FILE: openapi/configuration.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "context" "fmt" "net/http" "strings" ) // contextKeys are used to identify the type of value in the context. // Since these are string, it is possible to get a short description of the // context key for logging and debugging using key.String(). type contextKey string func (c contextKey) String() string { return "auth " + string(c) } var ( // ContextServerIndex uses a server configuration from the index. ContextServerIndex = contextKey("serverIndex") // ContextOperationServerIndices uses a server configuration from the index mapping. ContextOperationServerIndices = contextKey("serverOperationIndices") // ContextServerVariables overrides a server configuration variables. ContextServerVariables = contextKey("serverVariables") // ContextOperationServerVariables overrides a server configuration variables using operation specific values. ContextOperationServerVariables = contextKey("serverOperationVariables") ) // BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth type BasicAuth struct { UserName string `json:"userName,omitempty"` Password string `json:"password,omitempty"` } // APIKey provides API key based authentication to a request passed via context using ContextAPIKey type APIKey struct { Key string Prefix string } // ServerVariable stores the information about a server variable type ServerVariable struct { Description string DefaultValue string EnumValues []string } // ServerConfiguration stores the information about a server type ServerConfiguration struct { URL string Description string Variables map[string]ServerVariable } // ServerConfigurations stores multiple ServerConfiguration items type ServerConfigurations []ServerConfiguration // Configuration stores the configuration of the API client type Configuration struct { Host string `json:"host,omitempty"` Scheme string `json:"scheme,omitempty"` DefaultHeader map[string]string `json:"defaultHeader,omitempty"` UserAgent string `json:"userAgent,omitempty"` Debug bool `json:"debug,omitempty"` Servers ServerConfigurations OperationServers map[string]ServerConfigurations HTTPClient *http.Client } // NewConfiguration returns a new Configuration object func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), UserAgent: "OpenAPI-Generator/1.0.0/go", Debug: false, Servers: ServerConfigurations{ { URL: "", Description: "No description provided", }, }, OperationServers: map[string]ServerConfigurations{ }, } return cfg } // AddDefaultHeader adds a new HTTP header to the default header in the request func (c *Configuration) AddDefaultHeader(key string, value string) { c.DefaultHeader[key] = value } // URL formats template on a index using given variables func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { if index < 0 || len(sc) <= index { return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) } server := sc[index] url := server.URL // go through variables and replace placeholders for name, variable := range server.Variables { if value, ok := variables[name]; ok { found := bool(len(variable.EnumValues) == 0) for _, enumValue := range variable.EnumValues { if value == enumValue { found = true } } if !found { return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) } url = strings.Replace(url, "{"+name+"}", value, -1) } else { url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) } } return url, nil } // ServerURL returns URL based on server settings func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { return c.Servers.URL(index, variables) } func getServerIndex(ctx context.Context) (int, error) { si := ctx.Value(ContextServerIndex) if si != nil { if index, ok := si.(int); ok { return index, nil } return 0, reportError("Invalid type %T should be int", si) } return 0, nil } func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { osi := ctx.Value(ContextOperationServerIndices) if osi != nil { if operationIndices, ok := osi.(map[string]int); !ok { return 0, reportError("Invalid type %T should be map[string]int", osi) } else { index, ok := operationIndices[endpoint] if ok { return index, nil } } } return getServerIndex(ctx) } func getServerVariables(ctx context.Context) (map[string]string, error) { sv := ctx.Value(ContextServerVariables) if sv != nil { if variables, ok := sv.(map[string]string); ok { return variables, nil } return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) } return nil, nil } func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { osv := ctx.Value(ContextOperationServerVariables) if osv != nil { if operationVariables, ok := osv.(map[string]map[string]string); !ok { return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) } else { variables, ok := operationVariables[endpoint] if ok { return variables, nil } } } return getServerVariables(ctx) } // ServerURLWithContext returns a new server URL given an endpoint func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { sc, ok := c.OperationServers[endpoint] if !ok { sc = c.Servers } if ctx == nil { return sc.URL(0, nil) } index, err := getServerOperationIndex(ctx, endpoint) if err != nil { return "", err } variables, err := getServerOperationVariables(ctx, endpoint) if err != nil { return "", err } return sc.URL(index, variables) } ================================================ FILE: openapi/docs/Account.md ================================================ # Account ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **AccountType** | **string** | | **Created** | **string** | | **Id** | **string** | | **License** | **string** | | **PremiumData** | **float32** | | **Quota** | **float32** | | **ReferralCount** | **float32** | | **ReferralRenewalCountdown** | **float32** | | **Role** | **string** | | **Updated** | **string** | | **WarpPlus** | **bool** | | **Usage** | Pointer to **float32** | | [optional] ## Methods ### NewAccount `func NewAccount(accountType string, created string, id string, license string, premiumData float32, quota float32, referralCount float32, referralRenewalCountdown float32, role string, updated string, warpPlus bool, ) *Account` NewAccount instantiates a new Account object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewAccountWithDefaults `func NewAccountWithDefaults() *Account` NewAccountWithDefaults instantiates a new Account object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetAccountType `func (o *Account) GetAccountType() string` GetAccountType returns the AccountType field if non-nil, zero value otherwise. ### GetAccountTypeOk `func (o *Account) GetAccountTypeOk() (*string, bool)` GetAccountTypeOk returns a tuple with the AccountType field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetAccountType `func (o *Account) SetAccountType(v string)` SetAccountType sets AccountType field to given value. ### GetCreated `func (o *Account) GetCreated() string` GetCreated returns the Created field if non-nil, zero value otherwise. ### GetCreatedOk `func (o *Account) GetCreatedOk() (*string, bool)` GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCreated `func (o *Account) SetCreated(v string)` SetCreated sets Created field to given value. ### GetId `func (o *Account) GetId() string` GetId returns the Id field if non-nil, zero value otherwise. ### GetIdOk `func (o *Account) GetIdOk() (*string, bool)` GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetId `func (o *Account) SetId(v string)` SetId sets Id field to given value. ### GetLicense `func (o *Account) GetLicense() string` GetLicense returns the License field if non-nil, zero value otherwise. ### GetLicenseOk `func (o *Account) GetLicenseOk() (*string, bool)` GetLicenseOk returns a tuple with the License field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetLicense `func (o *Account) SetLicense(v string)` SetLicense sets License field to given value. ### GetPremiumData `func (o *Account) GetPremiumData() float32` GetPremiumData returns the PremiumData field if non-nil, zero value otherwise. ### GetPremiumDataOk `func (o *Account) GetPremiumDataOk() (*float32, bool)` GetPremiumDataOk returns a tuple with the PremiumData field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetPremiumData `func (o *Account) SetPremiumData(v float32)` SetPremiumData sets PremiumData field to given value. ### GetQuota `func (o *Account) GetQuota() float32` GetQuota returns the Quota field if non-nil, zero value otherwise. ### GetQuotaOk `func (o *Account) GetQuotaOk() (*float32, bool)` GetQuotaOk returns a tuple with the Quota field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetQuota `func (o *Account) SetQuota(v float32)` SetQuota sets Quota field to given value. ### GetReferralCount `func (o *Account) GetReferralCount() float32` GetReferralCount returns the ReferralCount field if non-nil, zero value otherwise. ### GetReferralCountOk `func (o *Account) GetReferralCountOk() (*float32, bool)` GetReferralCountOk returns a tuple with the ReferralCount field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetReferralCount `func (o *Account) SetReferralCount(v float32)` SetReferralCount sets ReferralCount field to given value. ### GetReferralRenewalCountdown `func (o *Account) GetReferralRenewalCountdown() float32` GetReferralRenewalCountdown returns the ReferralRenewalCountdown field if non-nil, zero value otherwise. ### GetReferralRenewalCountdownOk `func (o *Account) GetReferralRenewalCountdownOk() (*float32, bool)` GetReferralRenewalCountdownOk returns a tuple with the ReferralRenewalCountdown field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetReferralRenewalCountdown `func (o *Account) SetReferralRenewalCountdown(v float32)` SetReferralRenewalCountdown sets ReferralRenewalCountdown field to given value. ### GetRole `func (o *Account) GetRole() string` GetRole returns the Role field if non-nil, zero value otherwise. ### GetRoleOk `func (o *Account) GetRoleOk() (*string, bool)` GetRoleOk returns a tuple with the Role field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetRole `func (o *Account) SetRole(v string)` SetRole sets Role field to given value. ### GetUpdated `func (o *Account) GetUpdated() string` GetUpdated returns the Updated field if non-nil, zero value otherwise. ### GetUpdatedOk `func (o *Account) GetUpdatedOk() (*string, bool)` GetUpdatedOk returns a tuple with the Updated field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetUpdated `func (o *Account) SetUpdated(v string)` SetUpdated sets Updated field to given value. ### GetWarpPlus `func (o *Account) GetWarpPlus() bool` GetWarpPlus returns the WarpPlus field if non-nil, zero value otherwise. ### GetWarpPlusOk `func (o *Account) GetWarpPlusOk() (*bool, bool)` GetWarpPlusOk returns a tuple with the WarpPlus field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetWarpPlus `func (o *Account) SetWarpPlus(v bool)` SetWarpPlus sets WarpPlus field to given value. ### GetUsage `func (o *Account) GetUsage() float32` GetUsage returns the Usage field if non-nil, zero value otherwise. ### GetUsageOk `func (o *Account) GetUsageOk() (*float32, bool)` GetUsageOk returns a tuple with the Usage field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetUsage `func (o *Account) SetUsage(v float32)` SetUsage sets Usage field to given value. ### HasUsage `func (o *Account) HasUsage() bool` HasUsage returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/BoundDevice.md ================================================ # BoundDevice ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Activated** | **string** | | **Active** | **bool** | | **Created** | **string** | | **Id** | **string** | | **Model** | **string** | | **Name** | Pointer to **string** | | [optional] **Role** | **string** | | **Type** | **string** | | ## Methods ### NewBoundDevice `func NewBoundDevice(activated string, active bool, created string, id string, model string, role string, type_ string, ) *BoundDevice` NewBoundDevice instantiates a new BoundDevice object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewBoundDeviceWithDefaults `func NewBoundDeviceWithDefaults() *BoundDevice` NewBoundDeviceWithDefaults instantiates a new BoundDevice object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetActivated `func (o *BoundDevice) GetActivated() string` GetActivated returns the Activated field if non-nil, zero value otherwise. ### GetActivatedOk `func (o *BoundDevice) GetActivatedOk() (*string, bool)` GetActivatedOk returns a tuple with the Activated field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetActivated `func (o *BoundDevice) SetActivated(v string)` SetActivated sets Activated field to given value. ### GetActive `func (o *BoundDevice) GetActive() bool` GetActive returns the Active field if non-nil, zero value otherwise. ### GetActiveOk `func (o *BoundDevice) GetActiveOk() (*bool, bool)` GetActiveOk returns a tuple with the Active field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetActive `func (o *BoundDevice) SetActive(v bool)` SetActive sets Active field to given value. ### GetCreated `func (o *BoundDevice) GetCreated() string` GetCreated returns the Created field if non-nil, zero value otherwise. ### GetCreatedOk `func (o *BoundDevice) GetCreatedOk() (*string, bool)` GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCreated `func (o *BoundDevice) SetCreated(v string)` SetCreated sets Created field to given value. ### GetId `func (o *BoundDevice) GetId() string` GetId returns the Id field if non-nil, zero value otherwise. ### GetIdOk `func (o *BoundDevice) GetIdOk() (*string, bool)` GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetId `func (o *BoundDevice) SetId(v string)` SetId sets Id field to given value. ### GetModel `func (o *BoundDevice) GetModel() string` GetModel returns the Model field if non-nil, zero value otherwise. ### GetModelOk `func (o *BoundDevice) GetModelOk() (*string, bool)` GetModelOk returns a tuple with the Model field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetModel `func (o *BoundDevice) SetModel(v string)` SetModel sets Model field to given value. ### GetName `func (o *BoundDevice) GetName() string` GetName returns the Name field if non-nil, zero value otherwise. ### GetNameOk `func (o *BoundDevice) GetNameOk() (*string, bool)` GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetName `func (o *BoundDevice) SetName(v string)` SetName sets Name field to given value. ### HasName `func (o *BoundDevice) HasName() bool` HasName returns a boolean if a field has been set. ### GetRole `func (o *BoundDevice) GetRole() string` GetRole returns the Role field if non-nil, zero value otherwise. ### GetRoleOk `func (o *BoundDevice) GetRoleOk() (*string, bool)` GetRoleOk returns a tuple with the Role field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetRole `func (o *BoundDevice) SetRole(v string)` SetRole sets Role field to given value. ### GetType `func (o *BoundDevice) GetType() string` GetType returns the Type field if non-nil, zero value otherwise. ### GetTypeOk `func (o *BoundDevice) GetTypeOk() (*string, bool)` GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetType `func (o *BoundDevice) SetType(v string)` SetType sets Type field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/Config.md ================================================ # Config ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ClientId** | **string** | | **Interface** | [**ConfigInterface**](ConfigInterface.md) | | **Peers** | [**[]Peer**](Peer.md) | | **Services** | [**ConfigServices**](ConfigServices.md) | | ## Methods ### NewConfig `func NewConfig(clientId string, interface_ ConfigInterface, peers []Peer, services ConfigServices, ) *Config` NewConfig instantiates a new Config object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewConfigWithDefaults `func NewConfigWithDefaults() *Config` NewConfigWithDefaults instantiates a new Config object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetClientId `func (o *Config) GetClientId() string` GetClientId returns the ClientId field if non-nil, zero value otherwise. ### GetClientIdOk `func (o *Config) GetClientIdOk() (*string, bool)` GetClientIdOk returns a tuple with the ClientId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetClientId `func (o *Config) SetClientId(v string)` SetClientId sets ClientId field to given value. ### GetInterface `func (o *Config) GetInterface() ConfigInterface` GetInterface returns the Interface field if non-nil, zero value otherwise. ### GetInterfaceOk `func (o *Config) GetInterfaceOk() (*ConfigInterface, bool)` GetInterfaceOk returns a tuple with the Interface field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetInterface `func (o *Config) SetInterface(v ConfigInterface)` SetInterface sets Interface field to given value. ### GetPeers `func (o *Config) GetPeers() []Peer` GetPeers returns the Peers field if non-nil, zero value otherwise. ### GetPeersOk `func (o *Config) GetPeersOk() (*[]Peer, bool)` GetPeersOk returns a tuple with the Peers field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetPeers `func (o *Config) SetPeers(v []Peer)` SetPeers sets Peers field to given value. ### GetServices `func (o *Config) GetServices() ConfigServices` GetServices returns the Services field if non-nil, zero value otherwise. ### GetServicesOk `func (o *Config) GetServicesOk() (*ConfigServices, bool)` GetServicesOk returns a tuple with the Services field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetServices `func (o *Config) SetServices(v ConfigServices)` SetServices sets Services field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/ConfigInterface.md ================================================ # ConfigInterface ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Addresses** | [**NetworkAddress**](NetworkAddress.md) | | ## Methods ### NewConfigInterface `func NewConfigInterface(addresses NetworkAddress, ) *ConfigInterface` NewConfigInterface instantiates a new ConfigInterface object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewConfigInterfaceWithDefaults `func NewConfigInterfaceWithDefaults() *ConfigInterface` NewConfigInterfaceWithDefaults instantiates a new ConfigInterface object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetAddresses `func (o *ConfigInterface) GetAddresses() NetworkAddress` GetAddresses returns the Addresses field if non-nil, zero value otherwise. ### GetAddressesOk `func (o *ConfigInterface) GetAddressesOk() (*NetworkAddress, bool)` GetAddressesOk returns a tuple with the Addresses field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetAddresses `func (o *ConfigInterface) SetAddresses(v NetworkAddress)` SetAddresses sets Addresses field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/ConfigServices.md ================================================ # ConfigServices ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **HttpProxy** | **string** | | ## Methods ### NewConfigServices `func NewConfigServices(httpProxy string, ) *ConfigServices` NewConfigServices instantiates a new ConfigServices object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewConfigServicesWithDefaults `func NewConfigServicesWithDefaults() *ConfigServices` NewConfigServicesWithDefaults instantiates a new ConfigServices object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetHttpProxy `func (o *ConfigServices) GetHttpProxy() string` GetHttpProxy returns the HttpProxy field if non-nil, zero value otherwise. ### GetHttpProxyOk `func (o *ConfigServices) GetHttpProxyOk() (*string, bool)` GetHttpProxyOk returns a tuple with the HttpProxy field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetHttpProxy `func (o *ConfigServices) SetHttpProxy(v string)` SetHttpProxy sets HttpProxy field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/DefaultApi.md ================================================ # \DefaultAPI All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- [**DeleteBoundDevice**](DefaultAPI.md#DeleteBoundDevice) | **Delete** /{apiVersion}/reg/{sourceDeviceId}/account/reg/{boundDeviceId} | DeleteBoundDevice [**GetAccount**](DefaultAPI.md#GetAccount) | **Get** /{apiVersion}/reg/{sourceDeviceId}/account | GetAccount [**GetBoundDevices**](DefaultAPI.md#GetBoundDevices) | **Get** /{apiVersion}/reg/{sourceDeviceId}/account/devices | GetBoundDevices [**GetClientConfig**](DefaultAPI.md#GetClientConfig) | **Get** /{apiVersion}/client_config | GetClientConfig [**GetSourceDevice**](DefaultAPI.md#GetSourceDevice) | **Get** /{apiVersion}/reg/{sourceDeviceId} | GetSourceDevice [**Register**](DefaultAPI.md#Register) | **Post** /{apiVersion}/reg | Register [**ResetAccountLicense**](DefaultAPI.md#ResetAccountLicense) | **Post** /{apiVersion}/reg/{sourceDeviceId}/account/license | ResetAccountLicense [**UpdateAccount**](DefaultAPI.md#UpdateAccount) | **Put** /{apiVersion}/reg/{sourceDeviceId}/account | UpdateAccount [**UpdateBoundDevice**](DefaultAPI.md#UpdateBoundDevice) | **Patch** /{apiVersion}/reg/{sourceDeviceId}/account/reg/{boundDeviceId} | UpdateBoundDevice [**UpdateSourceDevice**](DefaultAPI.md#UpdateSourceDevice) | **Patch** /{apiVersion}/reg/{sourceDeviceId} | UpdateSourceDevice ## DeleteBoundDevice > DeleteBoundDevice(ctx, sourceDeviceId, apiVersion, boundDeviceId).Execute() DeleteBoundDevice ### Example ```go package main import ( "context" "fmt" "os" openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { sourceDeviceId := "sourceDeviceId_example" // string | apiVersion := "apiVersion_example" // string | boundDeviceId := "boundDeviceId_example" // string | configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) r, err := apiClient.DefaultAPI.DeleteBoundDevice(context.Background(), sourceDeviceId, apiVersion, boundDeviceId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.DeleteBoundDevice``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } } ``` ### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **sourceDeviceId** | **string** | | **apiVersion** | **string** | | **boundDeviceId** | **string** | | ### Other Parameters Other parameters are passed through a pointer to a apiDeleteBoundDeviceRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- ### Return type (empty response body) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetAccount > Account GetAccount(ctx, sourceDeviceId, apiVersion).Execute() GetAccount ### Example ```go package main import ( "context" "fmt" "os" openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { sourceDeviceId := "sourceDeviceId_example" // string | apiVersion := "apiVersion_example" // string | configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) resp, r, err := apiClient.DefaultAPI.GetAccount(context.Background(), sourceDeviceId, apiVersion).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetAccount``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetAccount`: Account fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetAccount`: %v\n", resp) } ``` ### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **sourceDeviceId** | **string** | | **apiVersion** | **string** | | ### Other Parameters Other parameters are passed through a pointer to a apiGetAccountRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- ### Return type [**Account**](Account.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetBoundDevices > []BoundDevice GetBoundDevices(ctx, sourceDeviceId, apiVersion).Execute() GetBoundDevices ### Example ```go package main import ( "context" "fmt" "os" openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { sourceDeviceId := "sourceDeviceId_example" // string | apiVersion := "apiVersion_example" // string | configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) resp, r, err := apiClient.DefaultAPI.GetBoundDevices(context.Background(), sourceDeviceId, apiVersion).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetBoundDevices``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetBoundDevices`: []BoundDevice fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetBoundDevices`: %v\n", resp) } ``` ### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **sourceDeviceId** | **string** | | **apiVersion** | **string** | | ### Other Parameters Other parameters are passed through a pointer to a apiGetBoundDevicesRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- ### Return type [**[]BoundDevice**](BoundDevice.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetClientConfig > GetClientConfig200Response GetClientConfig(ctx, apiVersion).Execute() GetClientConfig ### Example ```go package main import ( "context" "fmt" "os" openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { apiVersion := "apiVersion_example" // string | configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) resp, r, err := apiClient.DefaultAPI.GetClientConfig(context.Background(), apiVersion).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetClientConfig``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetClientConfig`: GetClientConfig200Response fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetClientConfig`: %v\n", resp) } ``` ### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **apiVersion** | **string** | | ### Other Parameters Other parameters are passed through a pointer to a apiGetClientConfigRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- ### Return type [**GetClientConfig200Response**](GetClientConfig200Response.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetSourceDevice > GetSourceDevice200Response GetSourceDevice(ctx, apiVersion, sourceDeviceId).Execute() GetSourceDevice ### Example ```go package main import ( "context" "fmt" "os" openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { apiVersion := "apiVersion_example" // string | sourceDeviceId := "sourceDeviceId_example" // string | configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) resp, r, err := apiClient.DefaultAPI.GetSourceDevice(context.Background(), apiVersion, sourceDeviceId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetSourceDevice``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetSourceDevice`: GetSourceDevice200Response fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetSourceDevice`: %v\n", resp) } ``` ### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **apiVersion** | **string** | | **sourceDeviceId** | **string** | | ### Other Parameters Other parameters are passed through a pointer to a apiGetSourceDeviceRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- ### Return type [**GetSourceDevice200Response**](GetSourceDevice200Response.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## Register > Register200Response Register(ctx, apiVersion).RegisterRequest(registerRequest).Execute() Register ### Example ```go package main import ( "context" "fmt" "os" openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { apiVersion := "apiVersion_example" // string | registerRequest := *openapiclient.NewRegisterRequest("FcmToken_example", "InstallId_example", "Key_example", "Locale_example", "Model_example", "Tos_example", "Type_example") // RegisterRequest | (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) resp, r, err := apiClient.DefaultAPI.Register(context.Background(), apiVersion).RegisterRequest(registerRequest).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.Register``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `Register`: Register200Response fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.Register`: %v\n", resp) } ``` ### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **apiVersion** | **string** | | ### Other Parameters Other parameters are passed through a pointer to a apiRegisterRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **registerRequest** | [**RegisterRequest**](RegisterRequest.md) | | ### Return type [**Register200Response**](Register200Response.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ResetAccountLicense > ResetAccountLicense200Response ResetAccountLicense(ctx, sourceDeviceId, apiVersion).Execute() ResetAccountLicense ### Example ```go package main import ( "context" "fmt" "os" openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { sourceDeviceId := "sourceDeviceId_example" // string | apiVersion := "apiVersion_example" // string | configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) resp, r, err := apiClient.DefaultAPI.ResetAccountLicense(context.Background(), sourceDeviceId, apiVersion).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.ResetAccountLicense``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `ResetAccountLicense`: ResetAccountLicense200Response fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.ResetAccountLicense`: %v\n", resp) } ``` ### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **sourceDeviceId** | **string** | | **apiVersion** | **string** | | ### Other Parameters Other parameters are passed through a pointer to a apiResetAccountLicenseRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- ### Return type [**ResetAccountLicense200Response**](ResetAccountLicense200Response.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## UpdateAccount > UpdateAccount200Response UpdateAccount(ctx, sourceDeviceId, apiVersion).UpdateAccountRequest(updateAccountRequest).Execute() UpdateAccount ### Example ```go package main import ( "context" "fmt" "os" openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { sourceDeviceId := "sourceDeviceId_example" // string | apiVersion := "apiVersion_example" // string | updateAccountRequest := *openapiclient.NewUpdateAccountRequest("License_example") // UpdateAccountRequest | (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) resp, r, err := apiClient.DefaultAPI.UpdateAccount(context.Background(), sourceDeviceId, apiVersion).UpdateAccountRequest(updateAccountRequest).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.UpdateAccount``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `UpdateAccount`: UpdateAccount200Response fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.UpdateAccount`: %v\n", resp) } ``` ### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **sourceDeviceId** | **string** | | **apiVersion** | **string** | | ### Other Parameters Other parameters are passed through a pointer to a apiUpdateAccountRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **updateAccountRequest** | [**UpdateAccountRequest**](UpdateAccountRequest.md) | | ### Return type [**UpdateAccount200Response**](UpdateAccount200Response.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## UpdateBoundDevice > []BoundDevice UpdateBoundDevice(ctx, sourceDeviceId, apiVersion, boundDeviceId).UpdateBoundDeviceRequest(updateBoundDeviceRequest).Execute() UpdateBoundDevice ### Example ```go package main import ( "context" "fmt" "os" openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { sourceDeviceId := "sourceDeviceId_example" // string | apiVersion := "apiVersion_example" // string | boundDeviceId := "boundDeviceId_example" // string | updateBoundDeviceRequest := *openapiclient.NewUpdateBoundDeviceRequest() // UpdateBoundDeviceRequest | (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) resp, r, err := apiClient.DefaultAPI.UpdateBoundDevice(context.Background(), sourceDeviceId, apiVersion, boundDeviceId).UpdateBoundDeviceRequest(updateBoundDeviceRequest).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.UpdateBoundDevice``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `UpdateBoundDevice`: []BoundDevice fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.UpdateBoundDevice`: %v\n", resp) } ``` ### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **sourceDeviceId** | **string** | | **apiVersion** | **string** | | **boundDeviceId** | **string** | | ### Other Parameters Other parameters are passed through a pointer to a apiUpdateBoundDeviceRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **updateBoundDeviceRequest** | [**UpdateBoundDeviceRequest**](UpdateBoundDeviceRequest.md) | | ### Return type [**[]BoundDevice**](BoundDevice.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## UpdateSourceDevice > UpdateSourceDevice200Response UpdateSourceDevice(ctx, apiVersion, sourceDeviceId).UpdateSourceDeviceRequest(updateSourceDeviceRequest).Execute() UpdateSourceDevice ### Example ```go package main import ( "context" "fmt" "os" openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { apiVersion := "apiVersion_example" // string | sourceDeviceId := "sourceDeviceId_example" // string | updateSourceDeviceRequest := *openapiclient.NewUpdateSourceDeviceRequest("Key_example") // UpdateSourceDeviceRequest | (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) resp, r, err := apiClient.DefaultAPI.UpdateSourceDevice(context.Background(), apiVersion, sourceDeviceId).UpdateSourceDeviceRequest(updateSourceDeviceRequest).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.UpdateSourceDevice``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `UpdateSourceDevice`: UpdateSourceDevice200Response fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.UpdateSourceDevice`: %v\n", resp) } ``` ### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **apiVersion** | **string** | | **sourceDeviceId** | **string** | | ### Other Parameters Other parameters are passed through a pointer to a apiUpdateSourceDeviceRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **updateSourceDeviceRequest** | [**UpdateSourceDeviceRequest**](UpdateSourceDeviceRequest.md) | | ### Return type [**UpdateSourceDevice200Response**](UpdateSourceDevice200Response.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/Endpoint.md ================================================ # Endpoint ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Host** | **string** | | **V4** | **string** | | **V6** | **string** | | ## Methods ### NewEndpoint `func NewEndpoint(host string, v4 string, v6 string, ) *Endpoint` NewEndpoint instantiates a new Endpoint object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewEndpointWithDefaults `func NewEndpointWithDefaults() *Endpoint` NewEndpointWithDefaults instantiates a new Endpoint object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetHost `func (o *Endpoint) GetHost() string` GetHost returns the Host field if non-nil, zero value otherwise. ### GetHostOk `func (o *Endpoint) GetHostOk() (*string, bool)` GetHostOk returns a tuple with the Host field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetHost `func (o *Endpoint) SetHost(v string)` SetHost sets Host field to given value. ### GetV4 `func (o *Endpoint) GetV4() string` GetV4 returns the V4 field if non-nil, zero value otherwise. ### GetV4Ok `func (o *Endpoint) GetV4Ok() (*string, bool)` GetV4Ok returns a tuple with the V4 field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetV4 `func (o *Endpoint) SetV4(v string)` SetV4 sets V4 field to given value. ### GetV6 `func (o *Endpoint) GetV6() string` GetV6 returns the V6 field if non-nil, zero value otherwise. ### GetV6Ok `func (o *Endpoint) GetV6Ok() (*string, bool)` GetV6Ok returns a tuple with the V6 field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetV6 `func (o *Endpoint) SetV6(v string)` SetV6 sets V6 field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/GetClientConfig200Response.md ================================================ # GetClientConfig200Response ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **CaptivePortal** | [**[]GetClientConfig200ResponseCaptivePortalInner**](GetClientConfig200ResponseCaptivePortalInner.md) | | **Denylist** | [**[]GetClientConfig200ResponseDenylistInner**](GetClientConfig200ResponseDenylistInner.md) | | **PremiumDataBytes** | **float32** | | **ReferralRewardBytes** | **float32** | | ## Methods ### NewGetClientConfig200Response `func NewGetClientConfig200Response(captivePortal []GetClientConfig200ResponseCaptivePortalInner, denylist []GetClientConfig200ResponseDenylistInner, premiumDataBytes float32, referralRewardBytes float32, ) *GetClientConfig200Response` NewGetClientConfig200Response instantiates a new GetClientConfig200Response object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewGetClientConfig200ResponseWithDefaults `func NewGetClientConfig200ResponseWithDefaults() *GetClientConfig200Response` NewGetClientConfig200ResponseWithDefaults instantiates a new GetClientConfig200Response object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetCaptivePortal `func (o *GetClientConfig200Response) GetCaptivePortal() []GetClientConfig200ResponseCaptivePortalInner` GetCaptivePortal returns the CaptivePortal field if non-nil, zero value otherwise. ### GetCaptivePortalOk `func (o *GetClientConfig200Response) GetCaptivePortalOk() (*[]GetClientConfig200ResponseCaptivePortalInner, bool)` GetCaptivePortalOk returns a tuple with the CaptivePortal field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCaptivePortal `func (o *GetClientConfig200Response) SetCaptivePortal(v []GetClientConfig200ResponseCaptivePortalInner)` SetCaptivePortal sets CaptivePortal field to given value. ### GetDenylist `func (o *GetClientConfig200Response) GetDenylist() []GetClientConfig200ResponseDenylistInner` GetDenylist returns the Denylist field if non-nil, zero value otherwise. ### GetDenylistOk `func (o *GetClientConfig200Response) GetDenylistOk() (*[]GetClientConfig200ResponseDenylistInner, bool)` GetDenylistOk returns a tuple with the Denylist field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetDenylist `func (o *GetClientConfig200Response) SetDenylist(v []GetClientConfig200ResponseDenylistInner)` SetDenylist sets Denylist field to given value. ### GetPremiumDataBytes `func (o *GetClientConfig200Response) GetPremiumDataBytes() float32` GetPremiumDataBytes returns the PremiumDataBytes field if non-nil, zero value otherwise. ### GetPremiumDataBytesOk `func (o *GetClientConfig200Response) GetPremiumDataBytesOk() (*float32, bool)` GetPremiumDataBytesOk returns a tuple with the PremiumDataBytes field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetPremiumDataBytes `func (o *GetClientConfig200Response) SetPremiumDataBytes(v float32)` SetPremiumDataBytes sets PremiumDataBytes field to given value. ### GetReferralRewardBytes `func (o *GetClientConfig200Response) GetReferralRewardBytes() float32` GetReferralRewardBytes returns the ReferralRewardBytes field if non-nil, zero value otherwise. ### GetReferralRewardBytesOk `func (o *GetClientConfig200Response) GetReferralRewardBytesOk() (*float32, bool)` GetReferralRewardBytesOk returns a tuple with the ReferralRewardBytes field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetReferralRewardBytes `func (o *GetClientConfig200Response) SetReferralRewardBytes(v float32)` SetReferralRewardBytes sets ReferralRewardBytes field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/GetClientConfig200ResponseCaptivePortalInner.md ================================================ # GetClientConfig200ResponseCaptivePortalInner ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | **string** | | **Networks** | [**[]GetClientConfig200ResponseCaptivePortalInnerNetworksInner**](GetClientConfig200ResponseCaptivePortalInnerNetworksInner.md) | | ## Methods ### NewGetClientConfig200ResponseCaptivePortalInner `func NewGetClientConfig200ResponseCaptivePortalInner(name string, networks []GetClientConfig200ResponseCaptivePortalInnerNetworksInner, ) *GetClientConfig200ResponseCaptivePortalInner` NewGetClientConfig200ResponseCaptivePortalInner instantiates a new GetClientConfig200ResponseCaptivePortalInner object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewGetClientConfig200ResponseCaptivePortalInnerWithDefaults `func NewGetClientConfig200ResponseCaptivePortalInnerWithDefaults() *GetClientConfig200ResponseCaptivePortalInner` NewGetClientConfig200ResponseCaptivePortalInnerWithDefaults instantiates a new GetClientConfig200ResponseCaptivePortalInner object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetName `func (o *GetClientConfig200ResponseCaptivePortalInner) GetName() string` GetName returns the Name field if non-nil, zero value otherwise. ### GetNameOk `func (o *GetClientConfig200ResponseCaptivePortalInner) GetNameOk() (*string, bool)` GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetName `func (o *GetClientConfig200ResponseCaptivePortalInner) SetName(v string)` SetName sets Name field to given value. ### GetNetworks `func (o *GetClientConfig200ResponseCaptivePortalInner) GetNetworks() []GetClientConfig200ResponseCaptivePortalInnerNetworksInner` GetNetworks returns the Networks field if non-nil, zero value otherwise. ### GetNetworksOk `func (o *GetClientConfig200ResponseCaptivePortalInner) GetNetworksOk() (*[]GetClientConfig200ResponseCaptivePortalInnerNetworksInner, bool)` GetNetworksOk returns a tuple with the Networks field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetNetworks `func (o *GetClientConfig200ResponseCaptivePortalInner) SetNetworks(v []GetClientConfig200ResponseCaptivePortalInnerNetworksInner)` SetNetworks sets Networks field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/GetClientConfig200ResponseCaptivePortalInnerNetworksInner.md ================================================ # GetClientConfig200ResponseCaptivePortalInnerNetworksInner ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Address** | **string** | | ## Methods ### NewGetClientConfig200ResponseCaptivePortalInnerNetworksInner `func NewGetClientConfig200ResponseCaptivePortalInnerNetworksInner(address string, ) *GetClientConfig200ResponseCaptivePortalInnerNetworksInner` NewGetClientConfig200ResponseCaptivePortalInnerNetworksInner instantiates a new GetClientConfig200ResponseCaptivePortalInnerNetworksInner object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewGetClientConfig200ResponseCaptivePortalInnerNetworksInnerWithDefaults `func NewGetClientConfig200ResponseCaptivePortalInnerNetworksInnerWithDefaults() *GetClientConfig200ResponseCaptivePortalInnerNetworksInner` NewGetClientConfig200ResponseCaptivePortalInnerNetworksInnerWithDefaults instantiates a new GetClientConfig200ResponseCaptivePortalInnerNetworksInner object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetAddress `func (o *GetClientConfig200ResponseCaptivePortalInnerNetworksInner) GetAddress() string` GetAddress returns the Address field if non-nil, zero value otherwise. ### GetAddressOk `func (o *GetClientConfig200ResponseCaptivePortalInnerNetworksInner) GetAddressOk() (*string, bool)` GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetAddress `func (o *GetClientConfig200ResponseCaptivePortalInnerNetworksInner) SetAddress(v string)` SetAddress sets Address field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/GetClientConfig200ResponseDenylistInner.md ================================================ # GetClientConfig200ResponseDenylistInner ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **AndroidPackages** | Pointer to **[]string** | | [optional] **Name** | **string** | | **Networks** | Pointer to [**GetClientConfig200ResponseDenylistInnerNetworks**](GetClientConfig200ResponseDenylistInnerNetworks.md) | | [optional] **Visible** | **bool** | | ## Methods ### NewGetClientConfig200ResponseDenylistInner `func NewGetClientConfig200ResponseDenylistInner(name string, visible bool, ) *GetClientConfig200ResponseDenylistInner` NewGetClientConfig200ResponseDenylistInner instantiates a new GetClientConfig200ResponseDenylistInner object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewGetClientConfig200ResponseDenylistInnerWithDefaults `func NewGetClientConfig200ResponseDenylistInnerWithDefaults() *GetClientConfig200ResponseDenylistInner` NewGetClientConfig200ResponseDenylistInnerWithDefaults instantiates a new GetClientConfig200ResponseDenylistInner object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetAndroidPackages `func (o *GetClientConfig200ResponseDenylistInner) GetAndroidPackages() []string` GetAndroidPackages returns the AndroidPackages field if non-nil, zero value otherwise. ### GetAndroidPackagesOk `func (o *GetClientConfig200ResponseDenylistInner) GetAndroidPackagesOk() (*[]string, bool)` GetAndroidPackagesOk returns a tuple with the AndroidPackages field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetAndroidPackages `func (o *GetClientConfig200ResponseDenylistInner) SetAndroidPackages(v []string)` SetAndroidPackages sets AndroidPackages field to given value. ### HasAndroidPackages `func (o *GetClientConfig200ResponseDenylistInner) HasAndroidPackages() bool` HasAndroidPackages returns a boolean if a field has been set. ### GetName `func (o *GetClientConfig200ResponseDenylistInner) GetName() string` GetName returns the Name field if non-nil, zero value otherwise. ### GetNameOk `func (o *GetClientConfig200ResponseDenylistInner) GetNameOk() (*string, bool)` GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetName `func (o *GetClientConfig200ResponseDenylistInner) SetName(v string)` SetName sets Name field to given value. ### GetNetworks `func (o *GetClientConfig200ResponseDenylistInner) GetNetworks() GetClientConfig200ResponseDenylistInnerNetworks` GetNetworks returns the Networks field if non-nil, zero value otherwise. ### GetNetworksOk `func (o *GetClientConfig200ResponseDenylistInner) GetNetworksOk() (*GetClientConfig200ResponseDenylistInnerNetworks, bool)` GetNetworksOk returns a tuple with the Networks field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetNetworks `func (o *GetClientConfig200ResponseDenylistInner) SetNetworks(v GetClientConfig200ResponseDenylistInnerNetworks)` SetNetworks sets Networks field to given value. ### HasNetworks `func (o *GetClientConfig200ResponseDenylistInner) HasNetworks() bool` HasNetworks returns a boolean if a field has been set. ### GetVisible `func (o *GetClientConfig200ResponseDenylistInner) GetVisible() bool` GetVisible returns the Visible field if non-nil, zero value otherwise. ### GetVisibleOk `func (o *GetClientConfig200ResponseDenylistInner) GetVisibleOk() (*bool, bool)` GetVisibleOk returns a tuple with the Visible field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetVisible `func (o *GetClientConfig200ResponseDenylistInner) SetVisible(v bool)` SetVisible sets Visible field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/GetClientConfig200ResponseDenylistInnerNetworks.md ================================================ # GetClientConfig200ResponseDenylistInnerNetworks ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **V4** | [**[]IPv4Network**](IPv4Network.md) | | **V6** | [**[]IPv6Network**](IPv6Network.md) | | ## Methods ### NewGetClientConfig200ResponseDenylistInnerNetworks `func NewGetClientConfig200ResponseDenylistInnerNetworks(v4 []IPv4Network, v6 []IPv6Network, ) *GetClientConfig200ResponseDenylistInnerNetworks` NewGetClientConfig200ResponseDenylistInnerNetworks instantiates a new GetClientConfig200ResponseDenylistInnerNetworks object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewGetClientConfig200ResponseDenylistInnerNetworksWithDefaults `func NewGetClientConfig200ResponseDenylistInnerNetworksWithDefaults() *GetClientConfig200ResponseDenylistInnerNetworks` NewGetClientConfig200ResponseDenylistInnerNetworksWithDefaults instantiates a new GetClientConfig200ResponseDenylistInnerNetworks object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetV4 `func (o *GetClientConfig200ResponseDenylistInnerNetworks) GetV4() []IPv4Network` GetV4 returns the V4 field if non-nil, zero value otherwise. ### GetV4Ok `func (o *GetClientConfig200ResponseDenylistInnerNetworks) GetV4Ok() (*[]IPv4Network, bool)` GetV4Ok returns a tuple with the V4 field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetV4 `func (o *GetClientConfig200ResponseDenylistInnerNetworks) SetV4(v []IPv4Network)` SetV4 sets V4 field to given value. ### GetV6 `func (o *GetClientConfig200ResponseDenylistInnerNetworks) GetV6() []IPv6Network` GetV6 returns the V6 field if non-nil, zero value otherwise. ### GetV6Ok `func (o *GetClientConfig200ResponseDenylistInnerNetworks) GetV6Ok() (*[]IPv6Network, bool)` GetV6Ok returns a tuple with the V6 field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetV6 `func (o *GetClientConfig200ResponseDenylistInnerNetworks) SetV6(v []IPv6Network)` SetV6 sets V6 field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/GetSourceDevice200Response.md ================================================ # GetSourceDevice200Response ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Created** | **string** | | **Enabled** | **bool** | | **FcmToken** | **string** | | **Id** | **string** | | **InstallId** | **string** | | **Key** | **string** | | **Locale** | **string** | | **Model** | **string** | | **Name** | **string** | | **Place** | **float32** | | **Tos** | **string** | | **Type** | **string** | | **Updated** | **string** | | **WaitlistEnabled** | **bool** | | **WarpEnabled** | **bool** | | **Account** | [**Account**](Account.md) | | **Config** | [**Config**](Config.md) | | ## Methods ### NewGetSourceDevice200Response `func NewGetSourceDevice200Response(created string, enabled bool, fcmToken string, id string, installId string, key string, locale string, model string, name string, place float32, tos string, type_ string, updated string, waitlistEnabled bool, warpEnabled bool, account Account, config Config, ) *GetSourceDevice200Response` NewGetSourceDevice200Response instantiates a new GetSourceDevice200Response object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewGetSourceDevice200ResponseWithDefaults `func NewGetSourceDevice200ResponseWithDefaults() *GetSourceDevice200Response` NewGetSourceDevice200ResponseWithDefaults instantiates a new GetSourceDevice200Response object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetCreated `func (o *GetSourceDevice200Response) GetCreated() string` GetCreated returns the Created field if non-nil, zero value otherwise. ### GetCreatedOk `func (o *GetSourceDevice200Response) GetCreatedOk() (*string, bool)` GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCreated `func (o *GetSourceDevice200Response) SetCreated(v string)` SetCreated sets Created field to given value. ### GetEnabled `func (o *GetSourceDevice200Response) GetEnabled() bool` GetEnabled returns the Enabled field if non-nil, zero value otherwise. ### GetEnabledOk `func (o *GetSourceDevice200Response) GetEnabledOk() (*bool, bool)` GetEnabledOk returns a tuple with the Enabled field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetEnabled `func (o *GetSourceDevice200Response) SetEnabled(v bool)` SetEnabled sets Enabled field to given value. ### GetFcmToken `func (o *GetSourceDevice200Response) GetFcmToken() string` GetFcmToken returns the FcmToken field if non-nil, zero value otherwise. ### GetFcmTokenOk `func (o *GetSourceDevice200Response) GetFcmTokenOk() (*string, bool)` GetFcmTokenOk returns a tuple with the FcmToken field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetFcmToken `func (o *GetSourceDevice200Response) SetFcmToken(v string)` SetFcmToken sets FcmToken field to given value. ### GetId `func (o *GetSourceDevice200Response) GetId() string` GetId returns the Id field if non-nil, zero value otherwise. ### GetIdOk `func (o *GetSourceDevice200Response) GetIdOk() (*string, bool)` GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetId `func (o *GetSourceDevice200Response) SetId(v string)` SetId sets Id field to given value. ### GetInstallId `func (o *GetSourceDevice200Response) GetInstallId() string` GetInstallId returns the InstallId field if non-nil, zero value otherwise. ### GetInstallIdOk `func (o *GetSourceDevice200Response) GetInstallIdOk() (*string, bool)` GetInstallIdOk returns a tuple with the InstallId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetInstallId `func (o *GetSourceDevice200Response) SetInstallId(v string)` SetInstallId sets InstallId field to given value. ### GetKey `func (o *GetSourceDevice200Response) GetKey() string` GetKey returns the Key field if non-nil, zero value otherwise. ### GetKeyOk `func (o *GetSourceDevice200Response) GetKeyOk() (*string, bool)` GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetKey `func (o *GetSourceDevice200Response) SetKey(v string)` SetKey sets Key field to given value. ### GetLocale `func (o *GetSourceDevice200Response) GetLocale() string` GetLocale returns the Locale field if non-nil, zero value otherwise. ### GetLocaleOk `func (o *GetSourceDevice200Response) GetLocaleOk() (*string, bool)` GetLocaleOk returns a tuple with the Locale field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetLocale `func (o *GetSourceDevice200Response) SetLocale(v string)` SetLocale sets Locale field to given value. ### GetModel `func (o *GetSourceDevice200Response) GetModel() string` GetModel returns the Model field if non-nil, zero value otherwise. ### GetModelOk `func (o *GetSourceDevice200Response) GetModelOk() (*string, bool)` GetModelOk returns a tuple with the Model field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetModel `func (o *GetSourceDevice200Response) SetModel(v string)` SetModel sets Model field to given value. ### GetName `func (o *GetSourceDevice200Response) GetName() string` GetName returns the Name field if non-nil, zero value otherwise. ### GetNameOk `func (o *GetSourceDevice200Response) GetNameOk() (*string, bool)` GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetName `func (o *GetSourceDevice200Response) SetName(v string)` SetName sets Name field to given value. ### GetPlace `func (o *GetSourceDevice200Response) GetPlace() float32` GetPlace returns the Place field if non-nil, zero value otherwise. ### GetPlaceOk `func (o *GetSourceDevice200Response) GetPlaceOk() (*float32, bool)` GetPlaceOk returns a tuple with the Place field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetPlace `func (o *GetSourceDevice200Response) SetPlace(v float32)` SetPlace sets Place field to given value. ### GetTos `func (o *GetSourceDevice200Response) GetTos() string` GetTos returns the Tos field if non-nil, zero value otherwise. ### GetTosOk `func (o *GetSourceDevice200Response) GetTosOk() (*string, bool)` GetTosOk returns a tuple with the Tos field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTos `func (o *GetSourceDevice200Response) SetTos(v string)` SetTos sets Tos field to given value. ### GetType `func (o *GetSourceDevice200Response) GetType() string` GetType returns the Type field if non-nil, zero value otherwise. ### GetTypeOk `func (o *GetSourceDevice200Response) GetTypeOk() (*string, bool)` GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetType `func (o *GetSourceDevice200Response) SetType(v string)` SetType sets Type field to given value. ### GetUpdated `func (o *GetSourceDevice200Response) GetUpdated() string` GetUpdated returns the Updated field if non-nil, zero value otherwise. ### GetUpdatedOk `func (o *GetSourceDevice200Response) GetUpdatedOk() (*string, bool)` GetUpdatedOk returns a tuple with the Updated field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetUpdated `func (o *GetSourceDevice200Response) SetUpdated(v string)` SetUpdated sets Updated field to given value. ### GetWaitlistEnabled `func (o *GetSourceDevice200Response) GetWaitlistEnabled() bool` GetWaitlistEnabled returns the WaitlistEnabled field if non-nil, zero value otherwise. ### GetWaitlistEnabledOk `func (o *GetSourceDevice200Response) GetWaitlistEnabledOk() (*bool, bool)` GetWaitlistEnabledOk returns a tuple with the WaitlistEnabled field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetWaitlistEnabled `func (o *GetSourceDevice200Response) SetWaitlistEnabled(v bool)` SetWaitlistEnabled sets WaitlistEnabled field to given value. ### GetWarpEnabled `func (o *GetSourceDevice200Response) GetWarpEnabled() bool` GetWarpEnabled returns the WarpEnabled field if non-nil, zero value otherwise. ### GetWarpEnabledOk `func (o *GetSourceDevice200Response) GetWarpEnabledOk() (*bool, bool)` GetWarpEnabledOk returns a tuple with the WarpEnabled field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetWarpEnabled `func (o *GetSourceDevice200Response) SetWarpEnabled(v bool)` SetWarpEnabled sets WarpEnabled field to given value. ### GetAccount `func (o *GetSourceDevice200Response) GetAccount() Account` GetAccount returns the Account field if non-nil, zero value otherwise. ### GetAccountOk `func (o *GetSourceDevice200Response) GetAccountOk() (*Account, bool)` GetAccountOk returns a tuple with the Account field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetAccount `func (o *GetSourceDevice200Response) SetAccount(v Account)` SetAccount sets Account field to given value. ### GetConfig `func (o *GetSourceDevice200Response) GetConfig() Config` GetConfig returns the Config field if non-nil, zero value otherwise. ### GetConfigOk `func (o *GetSourceDevice200Response) GetConfigOk() (*Config, bool)` GetConfigOk returns a tuple with the Config field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetConfig `func (o *GetSourceDevice200Response) SetConfig(v Config)` SetConfig sets Config field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/IPv4Network.md ================================================ # IPv4Network ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Address** | **string** | | **Netmask** | **string** | | ## Methods ### NewIPv4Network `func NewIPv4Network(address string, netmask string, ) *IPv4Network` NewIPv4Network instantiates a new IPv4Network object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewIPv4NetworkWithDefaults `func NewIPv4NetworkWithDefaults() *IPv4Network` NewIPv4NetworkWithDefaults instantiates a new IPv4Network object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetAddress `func (o *IPv4Network) GetAddress() string` GetAddress returns the Address field if non-nil, zero value otherwise. ### GetAddressOk `func (o *IPv4Network) GetAddressOk() (*string, bool)` GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetAddress `func (o *IPv4Network) SetAddress(v string)` SetAddress sets Address field to given value. ### GetNetmask `func (o *IPv4Network) GetNetmask() string` GetNetmask returns the Netmask field if non-nil, zero value otherwise. ### GetNetmaskOk `func (o *IPv4Network) GetNetmaskOk() (*string, bool)` GetNetmaskOk returns a tuple with the Netmask field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetNetmask `func (o *IPv4Network) SetNetmask(v string)` SetNetmask sets Netmask field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/IPv6Network.md ================================================ # IPv6Network ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Address** | **string** | | **Prefix** | **float32** | | ## Methods ### NewIPv6Network `func NewIPv6Network(address string, prefix float32, ) *IPv6Network` NewIPv6Network instantiates a new IPv6Network object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewIPv6NetworkWithDefaults `func NewIPv6NetworkWithDefaults() *IPv6Network` NewIPv6NetworkWithDefaults instantiates a new IPv6Network object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetAddress `func (o *IPv6Network) GetAddress() string` GetAddress returns the Address field if non-nil, zero value otherwise. ### GetAddressOk `func (o *IPv6Network) GetAddressOk() (*string, bool)` GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetAddress `func (o *IPv6Network) SetAddress(v string)` SetAddress sets Address field to given value. ### GetPrefix `func (o *IPv6Network) GetPrefix() float32` GetPrefix returns the Prefix field if non-nil, zero value otherwise. ### GetPrefixOk `func (o *IPv6Network) GetPrefixOk() (*float32, bool)` GetPrefixOk returns a tuple with the Prefix field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetPrefix `func (o *IPv6Network) SetPrefix(v float32)` SetPrefix sets Prefix field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/NetworkAddress.md ================================================ # NetworkAddress ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **V4** | **string** | | **V6** | **string** | | ## Methods ### NewNetworkAddress `func NewNetworkAddress(v4 string, v6 string, ) *NetworkAddress` NewNetworkAddress instantiates a new NetworkAddress object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewNetworkAddressWithDefaults `func NewNetworkAddressWithDefaults() *NetworkAddress` NewNetworkAddressWithDefaults instantiates a new NetworkAddress object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetV4 `func (o *NetworkAddress) GetV4() string` GetV4 returns the V4 field if non-nil, zero value otherwise. ### GetV4Ok `func (o *NetworkAddress) GetV4Ok() (*string, bool)` GetV4Ok returns a tuple with the V4 field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetV4 `func (o *NetworkAddress) SetV4(v string)` SetV4 sets V4 field to given value. ### GetV6 `func (o *NetworkAddress) GetV6() string` GetV6 returns the V6 field if non-nil, zero value otherwise. ### GetV6Ok `func (o *NetworkAddress) GetV6Ok() (*string, bool)` GetV6Ok returns a tuple with the V6 field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetV6 `func (o *NetworkAddress) SetV6(v string)` SetV6 sets V6 field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/Peer.md ================================================ # Peer ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Endpoint** | [**Endpoint**](Endpoint.md) | | **PublicKey** | **string** | | ## Methods ### NewPeer `func NewPeer(endpoint Endpoint, publicKey string, ) *Peer` NewPeer instantiates a new Peer object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewPeerWithDefaults `func NewPeerWithDefaults() *Peer` NewPeerWithDefaults instantiates a new Peer object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetEndpoint `func (o *Peer) GetEndpoint() Endpoint` GetEndpoint returns the Endpoint field if non-nil, zero value otherwise. ### GetEndpointOk `func (o *Peer) GetEndpointOk() (*Endpoint, bool)` GetEndpointOk returns a tuple with the Endpoint field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetEndpoint `func (o *Peer) SetEndpoint(v Endpoint)` SetEndpoint sets Endpoint field to given value. ### GetPublicKey `func (o *Peer) GetPublicKey() string` GetPublicKey returns the PublicKey field if non-nil, zero value otherwise. ### GetPublicKeyOk `func (o *Peer) GetPublicKeyOk() (*string, bool)` GetPublicKeyOk returns a tuple with the PublicKey field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetPublicKey `func (o *Peer) SetPublicKey(v string)` SetPublicKey sets PublicKey field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/Register200Response.md ================================================ # Register200Response ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Created** | **string** | | **Enabled** | **bool** | | **FcmToken** | **string** | | **Id** | **string** | | **InstallId** | **string** | | **Key** | **string** | | **Locale** | **string** | | **Model** | **string** | | **Name** | **string** | | **Place** | **float32** | | **Tos** | **string** | | **Type** | **string** | | **Updated** | **string** | | **WaitlistEnabled** | **bool** | | **WarpEnabled** | **bool** | | **Account** | [**Account**](Account.md) | | **Config** | [**Config**](Config.md) | | **Token** | **string** | | ## Methods ### NewRegister200Response `func NewRegister200Response(created string, enabled bool, fcmToken string, id string, installId string, key string, locale string, model string, name string, place float32, tos string, type_ string, updated string, waitlistEnabled bool, warpEnabled bool, account Account, config Config, token string, ) *Register200Response` NewRegister200Response instantiates a new Register200Response object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewRegister200ResponseWithDefaults `func NewRegister200ResponseWithDefaults() *Register200Response` NewRegister200ResponseWithDefaults instantiates a new Register200Response object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetCreated `func (o *Register200Response) GetCreated() string` GetCreated returns the Created field if non-nil, zero value otherwise. ### GetCreatedOk `func (o *Register200Response) GetCreatedOk() (*string, bool)` GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCreated `func (o *Register200Response) SetCreated(v string)` SetCreated sets Created field to given value. ### GetEnabled `func (o *Register200Response) GetEnabled() bool` GetEnabled returns the Enabled field if non-nil, zero value otherwise. ### GetEnabledOk `func (o *Register200Response) GetEnabledOk() (*bool, bool)` GetEnabledOk returns a tuple with the Enabled field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetEnabled `func (o *Register200Response) SetEnabled(v bool)` SetEnabled sets Enabled field to given value. ### GetFcmToken `func (o *Register200Response) GetFcmToken() string` GetFcmToken returns the FcmToken field if non-nil, zero value otherwise. ### GetFcmTokenOk `func (o *Register200Response) GetFcmTokenOk() (*string, bool)` GetFcmTokenOk returns a tuple with the FcmToken field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetFcmToken `func (o *Register200Response) SetFcmToken(v string)` SetFcmToken sets FcmToken field to given value. ### GetId `func (o *Register200Response) GetId() string` GetId returns the Id field if non-nil, zero value otherwise. ### GetIdOk `func (o *Register200Response) GetIdOk() (*string, bool)` GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetId `func (o *Register200Response) SetId(v string)` SetId sets Id field to given value. ### GetInstallId `func (o *Register200Response) GetInstallId() string` GetInstallId returns the InstallId field if non-nil, zero value otherwise. ### GetInstallIdOk `func (o *Register200Response) GetInstallIdOk() (*string, bool)` GetInstallIdOk returns a tuple with the InstallId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetInstallId `func (o *Register200Response) SetInstallId(v string)` SetInstallId sets InstallId field to given value. ### GetKey `func (o *Register200Response) GetKey() string` GetKey returns the Key field if non-nil, zero value otherwise. ### GetKeyOk `func (o *Register200Response) GetKeyOk() (*string, bool)` GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetKey `func (o *Register200Response) SetKey(v string)` SetKey sets Key field to given value. ### GetLocale `func (o *Register200Response) GetLocale() string` GetLocale returns the Locale field if non-nil, zero value otherwise. ### GetLocaleOk `func (o *Register200Response) GetLocaleOk() (*string, bool)` GetLocaleOk returns a tuple with the Locale field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetLocale `func (o *Register200Response) SetLocale(v string)` SetLocale sets Locale field to given value. ### GetModel `func (o *Register200Response) GetModel() string` GetModel returns the Model field if non-nil, zero value otherwise. ### GetModelOk `func (o *Register200Response) GetModelOk() (*string, bool)` GetModelOk returns a tuple with the Model field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetModel `func (o *Register200Response) SetModel(v string)` SetModel sets Model field to given value. ### GetName `func (o *Register200Response) GetName() string` GetName returns the Name field if non-nil, zero value otherwise. ### GetNameOk `func (o *Register200Response) GetNameOk() (*string, bool)` GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetName `func (o *Register200Response) SetName(v string)` SetName sets Name field to given value. ### GetPlace `func (o *Register200Response) GetPlace() float32` GetPlace returns the Place field if non-nil, zero value otherwise. ### GetPlaceOk `func (o *Register200Response) GetPlaceOk() (*float32, bool)` GetPlaceOk returns a tuple with the Place field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetPlace `func (o *Register200Response) SetPlace(v float32)` SetPlace sets Place field to given value. ### GetTos `func (o *Register200Response) GetTos() string` GetTos returns the Tos field if non-nil, zero value otherwise. ### GetTosOk `func (o *Register200Response) GetTosOk() (*string, bool)` GetTosOk returns a tuple with the Tos field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTos `func (o *Register200Response) SetTos(v string)` SetTos sets Tos field to given value. ### GetType `func (o *Register200Response) GetType() string` GetType returns the Type field if non-nil, zero value otherwise. ### GetTypeOk `func (o *Register200Response) GetTypeOk() (*string, bool)` GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetType `func (o *Register200Response) SetType(v string)` SetType sets Type field to given value. ### GetUpdated `func (o *Register200Response) GetUpdated() string` GetUpdated returns the Updated field if non-nil, zero value otherwise. ### GetUpdatedOk `func (o *Register200Response) GetUpdatedOk() (*string, bool)` GetUpdatedOk returns a tuple with the Updated field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetUpdated `func (o *Register200Response) SetUpdated(v string)` SetUpdated sets Updated field to given value. ### GetWaitlistEnabled `func (o *Register200Response) GetWaitlistEnabled() bool` GetWaitlistEnabled returns the WaitlistEnabled field if non-nil, zero value otherwise. ### GetWaitlistEnabledOk `func (o *Register200Response) GetWaitlistEnabledOk() (*bool, bool)` GetWaitlistEnabledOk returns a tuple with the WaitlistEnabled field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetWaitlistEnabled `func (o *Register200Response) SetWaitlistEnabled(v bool)` SetWaitlistEnabled sets WaitlistEnabled field to given value. ### GetWarpEnabled `func (o *Register200Response) GetWarpEnabled() bool` GetWarpEnabled returns the WarpEnabled field if non-nil, zero value otherwise. ### GetWarpEnabledOk `func (o *Register200Response) GetWarpEnabledOk() (*bool, bool)` GetWarpEnabledOk returns a tuple with the WarpEnabled field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetWarpEnabled `func (o *Register200Response) SetWarpEnabled(v bool)` SetWarpEnabled sets WarpEnabled field to given value. ### GetAccount `func (o *Register200Response) GetAccount() Account` GetAccount returns the Account field if non-nil, zero value otherwise. ### GetAccountOk `func (o *Register200Response) GetAccountOk() (*Account, bool)` GetAccountOk returns a tuple with the Account field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetAccount `func (o *Register200Response) SetAccount(v Account)` SetAccount sets Account field to given value. ### GetConfig `func (o *Register200Response) GetConfig() Config` GetConfig returns the Config field if non-nil, zero value otherwise. ### GetConfigOk `func (o *Register200Response) GetConfigOk() (*Config, bool)` GetConfigOk returns a tuple with the Config field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetConfig `func (o *Register200Response) SetConfig(v Config)` SetConfig sets Config field to given value. ### GetToken `func (o *Register200Response) GetToken() string` GetToken returns the Token field if non-nil, zero value otherwise. ### GetTokenOk `func (o *Register200Response) GetTokenOk() (*string, bool)` GetTokenOk returns a tuple with the Token field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetToken `func (o *Register200Response) SetToken(v string)` SetToken sets Token field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/RegisterRequest.md ================================================ # RegisterRequest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **FcmToken** | **string** | | **InstallId** | **string** | | **Key** | **string** | | **Locale** | **string** | | **Model** | **string** | | **Tos** | **string** | | **Type** | **string** | | ## Methods ### NewRegisterRequest `func NewRegisterRequest(fcmToken string, installId string, key string, locale string, model string, tos string, type_ string, ) *RegisterRequest` NewRegisterRequest instantiates a new RegisterRequest object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewRegisterRequestWithDefaults `func NewRegisterRequestWithDefaults() *RegisterRequest` NewRegisterRequestWithDefaults instantiates a new RegisterRequest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetFcmToken `func (o *RegisterRequest) GetFcmToken() string` GetFcmToken returns the FcmToken field if non-nil, zero value otherwise. ### GetFcmTokenOk `func (o *RegisterRequest) GetFcmTokenOk() (*string, bool)` GetFcmTokenOk returns a tuple with the FcmToken field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetFcmToken `func (o *RegisterRequest) SetFcmToken(v string)` SetFcmToken sets FcmToken field to given value. ### GetInstallId `func (o *RegisterRequest) GetInstallId() string` GetInstallId returns the InstallId field if non-nil, zero value otherwise. ### GetInstallIdOk `func (o *RegisterRequest) GetInstallIdOk() (*string, bool)` GetInstallIdOk returns a tuple with the InstallId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetInstallId `func (o *RegisterRequest) SetInstallId(v string)` SetInstallId sets InstallId field to given value. ### GetKey `func (o *RegisterRequest) GetKey() string` GetKey returns the Key field if non-nil, zero value otherwise. ### GetKeyOk `func (o *RegisterRequest) GetKeyOk() (*string, bool)` GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetKey `func (o *RegisterRequest) SetKey(v string)` SetKey sets Key field to given value. ### GetLocale `func (o *RegisterRequest) GetLocale() string` GetLocale returns the Locale field if non-nil, zero value otherwise. ### GetLocaleOk `func (o *RegisterRequest) GetLocaleOk() (*string, bool)` GetLocaleOk returns a tuple with the Locale field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetLocale `func (o *RegisterRequest) SetLocale(v string)` SetLocale sets Locale field to given value. ### GetModel `func (o *RegisterRequest) GetModel() string` GetModel returns the Model field if non-nil, zero value otherwise. ### GetModelOk `func (o *RegisterRequest) GetModelOk() (*string, bool)` GetModelOk returns a tuple with the Model field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetModel `func (o *RegisterRequest) SetModel(v string)` SetModel sets Model field to given value. ### GetTos `func (o *RegisterRequest) GetTos() string` GetTos returns the Tos field if non-nil, zero value otherwise. ### GetTosOk `func (o *RegisterRequest) GetTosOk() (*string, bool)` GetTosOk returns a tuple with the Tos field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTos `func (o *RegisterRequest) SetTos(v string)` SetTos sets Tos field to given value. ### GetType `func (o *RegisterRequest) GetType() string` GetType returns the Type field if non-nil, zero value otherwise. ### GetTypeOk `func (o *RegisterRequest) GetTypeOk() (*string, bool)` GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetType `func (o *RegisterRequest) SetType(v string)` SetType sets Type field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/ResetAccountLicense200Response.md ================================================ # ResetAccountLicense200Response ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **License** | **string** | | ## Methods ### NewResetAccountLicense200Response `func NewResetAccountLicense200Response(license string, ) *ResetAccountLicense200Response` NewResetAccountLicense200Response instantiates a new ResetAccountLicense200Response object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewResetAccountLicense200ResponseWithDefaults `func NewResetAccountLicense200ResponseWithDefaults() *ResetAccountLicense200Response` NewResetAccountLicense200ResponseWithDefaults instantiates a new ResetAccountLicense200Response object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetLicense `func (o *ResetAccountLicense200Response) GetLicense() string` GetLicense returns the License field if non-nil, zero value otherwise. ### GetLicenseOk `func (o *ResetAccountLicense200Response) GetLicenseOk() (*string, bool)` GetLicenseOk returns a tuple with the License field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetLicense `func (o *ResetAccountLicense200Response) SetLicense(v string)` SetLicense sets License field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/SourceDevice.md ================================================ # SourceDevice ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Created** | **string** | | **Enabled** | **bool** | | **FcmToken** | **string** | | **Id** | **string** | | **InstallId** | **string** | | **Key** | **string** | | **Locale** | **string** | | **Model** | **string** | | **Name** | **string** | | **Place** | **float32** | | **Tos** | **string** | | **Type** | **string** | | **Updated** | **string** | | **WaitlistEnabled** | **bool** | | **WarpEnabled** | **bool** | | ## Methods ### NewSourceDevice `func NewSourceDevice(created string, enabled bool, fcmToken string, id string, installId string, key string, locale string, model string, name string, place float32, tos string, type_ string, updated string, waitlistEnabled bool, warpEnabled bool, ) *SourceDevice` NewSourceDevice instantiates a new SourceDevice object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewSourceDeviceWithDefaults `func NewSourceDeviceWithDefaults() *SourceDevice` NewSourceDeviceWithDefaults instantiates a new SourceDevice object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetCreated `func (o *SourceDevice) GetCreated() string` GetCreated returns the Created field if non-nil, zero value otherwise. ### GetCreatedOk `func (o *SourceDevice) GetCreatedOk() (*string, bool)` GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCreated `func (o *SourceDevice) SetCreated(v string)` SetCreated sets Created field to given value. ### GetEnabled `func (o *SourceDevice) GetEnabled() bool` GetEnabled returns the Enabled field if non-nil, zero value otherwise. ### GetEnabledOk `func (o *SourceDevice) GetEnabledOk() (*bool, bool)` GetEnabledOk returns a tuple with the Enabled field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetEnabled `func (o *SourceDevice) SetEnabled(v bool)` SetEnabled sets Enabled field to given value. ### GetFcmToken `func (o *SourceDevice) GetFcmToken() string` GetFcmToken returns the FcmToken field if non-nil, zero value otherwise. ### GetFcmTokenOk `func (o *SourceDevice) GetFcmTokenOk() (*string, bool)` GetFcmTokenOk returns a tuple with the FcmToken field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetFcmToken `func (o *SourceDevice) SetFcmToken(v string)` SetFcmToken sets FcmToken field to given value. ### GetId `func (o *SourceDevice) GetId() string` GetId returns the Id field if non-nil, zero value otherwise. ### GetIdOk `func (o *SourceDevice) GetIdOk() (*string, bool)` GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetId `func (o *SourceDevice) SetId(v string)` SetId sets Id field to given value. ### GetInstallId `func (o *SourceDevice) GetInstallId() string` GetInstallId returns the InstallId field if non-nil, zero value otherwise. ### GetInstallIdOk `func (o *SourceDevice) GetInstallIdOk() (*string, bool)` GetInstallIdOk returns a tuple with the InstallId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetInstallId `func (o *SourceDevice) SetInstallId(v string)` SetInstallId sets InstallId field to given value. ### GetKey `func (o *SourceDevice) GetKey() string` GetKey returns the Key field if non-nil, zero value otherwise. ### GetKeyOk `func (o *SourceDevice) GetKeyOk() (*string, bool)` GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetKey `func (o *SourceDevice) SetKey(v string)` SetKey sets Key field to given value. ### GetLocale `func (o *SourceDevice) GetLocale() string` GetLocale returns the Locale field if non-nil, zero value otherwise. ### GetLocaleOk `func (o *SourceDevice) GetLocaleOk() (*string, bool)` GetLocaleOk returns a tuple with the Locale field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetLocale `func (o *SourceDevice) SetLocale(v string)` SetLocale sets Locale field to given value. ### GetModel `func (o *SourceDevice) GetModel() string` GetModel returns the Model field if non-nil, zero value otherwise. ### GetModelOk `func (o *SourceDevice) GetModelOk() (*string, bool)` GetModelOk returns a tuple with the Model field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetModel `func (o *SourceDevice) SetModel(v string)` SetModel sets Model field to given value. ### GetName `func (o *SourceDevice) GetName() string` GetName returns the Name field if non-nil, zero value otherwise. ### GetNameOk `func (o *SourceDevice) GetNameOk() (*string, bool)` GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetName `func (o *SourceDevice) SetName(v string)` SetName sets Name field to given value. ### GetPlace `func (o *SourceDevice) GetPlace() float32` GetPlace returns the Place field if non-nil, zero value otherwise. ### GetPlaceOk `func (o *SourceDevice) GetPlaceOk() (*float32, bool)` GetPlaceOk returns a tuple with the Place field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetPlace `func (o *SourceDevice) SetPlace(v float32)` SetPlace sets Place field to given value. ### GetTos `func (o *SourceDevice) GetTos() string` GetTos returns the Tos field if non-nil, zero value otherwise. ### GetTosOk `func (o *SourceDevice) GetTosOk() (*string, bool)` GetTosOk returns a tuple with the Tos field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTos `func (o *SourceDevice) SetTos(v string)` SetTos sets Tos field to given value. ### GetType `func (o *SourceDevice) GetType() string` GetType returns the Type field if non-nil, zero value otherwise. ### GetTypeOk `func (o *SourceDevice) GetTypeOk() (*string, bool)` GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetType `func (o *SourceDevice) SetType(v string)` SetType sets Type field to given value. ### GetUpdated `func (o *SourceDevice) GetUpdated() string` GetUpdated returns the Updated field if non-nil, zero value otherwise. ### GetUpdatedOk `func (o *SourceDevice) GetUpdatedOk() (*string, bool)` GetUpdatedOk returns a tuple with the Updated field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetUpdated `func (o *SourceDevice) SetUpdated(v string)` SetUpdated sets Updated field to given value. ### GetWaitlistEnabled `func (o *SourceDevice) GetWaitlistEnabled() bool` GetWaitlistEnabled returns the WaitlistEnabled field if non-nil, zero value otherwise. ### GetWaitlistEnabledOk `func (o *SourceDevice) GetWaitlistEnabledOk() (*bool, bool)` GetWaitlistEnabledOk returns a tuple with the WaitlistEnabled field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetWaitlistEnabled `func (o *SourceDevice) SetWaitlistEnabled(v bool)` SetWaitlistEnabled sets WaitlistEnabled field to given value. ### GetWarpEnabled `func (o *SourceDevice) GetWarpEnabled() bool` GetWarpEnabled returns the WarpEnabled field if non-nil, zero value otherwise. ### GetWarpEnabledOk `func (o *SourceDevice) GetWarpEnabledOk() (*bool, bool)` GetWarpEnabledOk returns a tuple with the WarpEnabled field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetWarpEnabled `func (o *SourceDevice) SetWarpEnabled(v bool)` SetWarpEnabled sets WarpEnabled field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/UpdateAccount200Response.md ================================================ # UpdateAccount200Response ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Created** | **string** | | **Id** | **string** | | **PremiumData** | **float32** | | **Quota** | **float32** | | **ReferralCount** | **float32** | | **ReferralRenewalCountdown** | **float32** | | **Role** | **string** | | **Updated** | **string** | | **WarpPlus** | **bool** | | ## Methods ### NewUpdateAccount200Response `func NewUpdateAccount200Response(created string, id string, premiumData float32, quota float32, referralCount float32, referralRenewalCountdown float32, role string, updated string, warpPlus bool, ) *UpdateAccount200Response` NewUpdateAccount200Response instantiates a new UpdateAccount200Response object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewUpdateAccount200ResponseWithDefaults `func NewUpdateAccount200ResponseWithDefaults() *UpdateAccount200Response` NewUpdateAccount200ResponseWithDefaults instantiates a new UpdateAccount200Response object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetCreated `func (o *UpdateAccount200Response) GetCreated() string` GetCreated returns the Created field if non-nil, zero value otherwise. ### GetCreatedOk `func (o *UpdateAccount200Response) GetCreatedOk() (*string, bool)` GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCreated `func (o *UpdateAccount200Response) SetCreated(v string)` SetCreated sets Created field to given value. ### GetId `func (o *UpdateAccount200Response) GetId() string` GetId returns the Id field if non-nil, zero value otherwise. ### GetIdOk `func (o *UpdateAccount200Response) GetIdOk() (*string, bool)` GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetId `func (o *UpdateAccount200Response) SetId(v string)` SetId sets Id field to given value. ### GetPremiumData `func (o *UpdateAccount200Response) GetPremiumData() float32` GetPremiumData returns the PremiumData field if non-nil, zero value otherwise. ### GetPremiumDataOk `func (o *UpdateAccount200Response) GetPremiumDataOk() (*float32, bool)` GetPremiumDataOk returns a tuple with the PremiumData field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetPremiumData `func (o *UpdateAccount200Response) SetPremiumData(v float32)` SetPremiumData sets PremiumData field to given value. ### GetQuota `func (o *UpdateAccount200Response) GetQuota() float32` GetQuota returns the Quota field if non-nil, zero value otherwise. ### GetQuotaOk `func (o *UpdateAccount200Response) GetQuotaOk() (*float32, bool)` GetQuotaOk returns a tuple with the Quota field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetQuota `func (o *UpdateAccount200Response) SetQuota(v float32)` SetQuota sets Quota field to given value. ### GetReferralCount `func (o *UpdateAccount200Response) GetReferralCount() float32` GetReferralCount returns the ReferralCount field if non-nil, zero value otherwise. ### GetReferralCountOk `func (o *UpdateAccount200Response) GetReferralCountOk() (*float32, bool)` GetReferralCountOk returns a tuple with the ReferralCount field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetReferralCount `func (o *UpdateAccount200Response) SetReferralCount(v float32)` SetReferralCount sets ReferralCount field to given value. ### GetReferralRenewalCountdown `func (o *UpdateAccount200Response) GetReferralRenewalCountdown() float32` GetReferralRenewalCountdown returns the ReferralRenewalCountdown field if non-nil, zero value otherwise. ### GetReferralRenewalCountdownOk `func (o *UpdateAccount200Response) GetReferralRenewalCountdownOk() (*float32, bool)` GetReferralRenewalCountdownOk returns a tuple with the ReferralRenewalCountdown field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetReferralRenewalCountdown `func (o *UpdateAccount200Response) SetReferralRenewalCountdown(v float32)` SetReferralRenewalCountdown sets ReferralRenewalCountdown field to given value. ### GetRole `func (o *UpdateAccount200Response) GetRole() string` GetRole returns the Role field if non-nil, zero value otherwise. ### GetRoleOk `func (o *UpdateAccount200Response) GetRoleOk() (*string, bool)` GetRoleOk returns a tuple with the Role field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetRole `func (o *UpdateAccount200Response) SetRole(v string)` SetRole sets Role field to given value. ### GetUpdated `func (o *UpdateAccount200Response) GetUpdated() string` GetUpdated returns the Updated field if non-nil, zero value otherwise. ### GetUpdatedOk `func (o *UpdateAccount200Response) GetUpdatedOk() (*string, bool)` GetUpdatedOk returns a tuple with the Updated field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetUpdated `func (o *UpdateAccount200Response) SetUpdated(v string)` SetUpdated sets Updated field to given value. ### GetWarpPlus `func (o *UpdateAccount200Response) GetWarpPlus() bool` GetWarpPlus returns the WarpPlus field if non-nil, zero value otherwise. ### GetWarpPlusOk `func (o *UpdateAccount200Response) GetWarpPlusOk() (*bool, bool)` GetWarpPlusOk returns a tuple with the WarpPlus field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetWarpPlus `func (o *UpdateAccount200Response) SetWarpPlus(v bool)` SetWarpPlus sets WarpPlus field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/UpdateAccountRequest.md ================================================ # UpdateAccountRequest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **License** | **string** | | ## Methods ### NewUpdateAccountRequest `func NewUpdateAccountRequest(license string, ) *UpdateAccountRequest` NewUpdateAccountRequest instantiates a new UpdateAccountRequest object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewUpdateAccountRequestWithDefaults `func NewUpdateAccountRequestWithDefaults() *UpdateAccountRequest` NewUpdateAccountRequestWithDefaults instantiates a new UpdateAccountRequest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetLicense `func (o *UpdateAccountRequest) GetLicense() string` GetLicense returns the License field if non-nil, zero value otherwise. ### GetLicenseOk `func (o *UpdateAccountRequest) GetLicenseOk() (*string, bool)` GetLicenseOk returns a tuple with the License field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetLicense `func (o *UpdateAccountRequest) SetLicense(v string)` SetLicense sets License field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/UpdateBoundDeviceRequest.md ================================================ # UpdateBoundDeviceRequest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Active** | Pointer to **bool** | | [optional] **Name** | Pointer to **string** | | [optional] ## Methods ### NewUpdateBoundDeviceRequest `func NewUpdateBoundDeviceRequest() *UpdateBoundDeviceRequest` NewUpdateBoundDeviceRequest instantiates a new UpdateBoundDeviceRequest object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewUpdateBoundDeviceRequestWithDefaults `func NewUpdateBoundDeviceRequestWithDefaults() *UpdateBoundDeviceRequest` NewUpdateBoundDeviceRequestWithDefaults instantiates a new UpdateBoundDeviceRequest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetActive `func (o *UpdateBoundDeviceRequest) GetActive() bool` GetActive returns the Active field if non-nil, zero value otherwise. ### GetActiveOk `func (o *UpdateBoundDeviceRequest) GetActiveOk() (*bool, bool)` GetActiveOk returns a tuple with the Active field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetActive `func (o *UpdateBoundDeviceRequest) SetActive(v bool)` SetActive sets Active field to given value. ### HasActive `func (o *UpdateBoundDeviceRequest) HasActive() bool` HasActive returns a boolean if a field has been set. ### GetName `func (o *UpdateBoundDeviceRequest) GetName() string` GetName returns the Name field if non-nil, zero value otherwise. ### GetNameOk `func (o *UpdateBoundDeviceRequest) GetNameOk() (*string, bool)` GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetName `func (o *UpdateBoundDeviceRequest) SetName(v string)` SetName sets Name field to given value. ### HasName `func (o *UpdateBoundDeviceRequest) HasName() bool` HasName returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/UpdateSourceDevice200Response.md ================================================ # UpdateSourceDevice200Response ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Created** | **string** | | **Enabled** | **bool** | | **FcmToken** | **string** | | **Id** | **string** | | **InstallId** | **string** | | **Key** | **string** | | **Locale** | **string** | | **Model** | **string** | | **Name** | **string** | | **Place** | **float32** | | **Tos** | **string** | | **Type** | **string** | | **Updated** | **string** | | **WaitlistEnabled** | **bool** | | **WarpEnabled** | **bool** | | **Account** | [**Account**](Account.md) | | **Config** | [**Config**](Config.md) | | ## Methods ### NewUpdateSourceDevice200Response `func NewUpdateSourceDevice200Response(created string, enabled bool, fcmToken string, id string, installId string, key string, locale string, model string, name string, place float32, tos string, type_ string, updated string, waitlistEnabled bool, warpEnabled bool, account Account, config Config, ) *UpdateSourceDevice200Response` NewUpdateSourceDevice200Response instantiates a new UpdateSourceDevice200Response object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewUpdateSourceDevice200ResponseWithDefaults `func NewUpdateSourceDevice200ResponseWithDefaults() *UpdateSourceDevice200Response` NewUpdateSourceDevice200ResponseWithDefaults instantiates a new UpdateSourceDevice200Response object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetCreated `func (o *UpdateSourceDevice200Response) GetCreated() string` GetCreated returns the Created field if non-nil, zero value otherwise. ### GetCreatedOk `func (o *UpdateSourceDevice200Response) GetCreatedOk() (*string, bool)` GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCreated `func (o *UpdateSourceDevice200Response) SetCreated(v string)` SetCreated sets Created field to given value. ### GetEnabled `func (o *UpdateSourceDevice200Response) GetEnabled() bool` GetEnabled returns the Enabled field if non-nil, zero value otherwise. ### GetEnabledOk `func (o *UpdateSourceDevice200Response) GetEnabledOk() (*bool, bool)` GetEnabledOk returns a tuple with the Enabled field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetEnabled `func (o *UpdateSourceDevice200Response) SetEnabled(v bool)` SetEnabled sets Enabled field to given value. ### GetFcmToken `func (o *UpdateSourceDevice200Response) GetFcmToken() string` GetFcmToken returns the FcmToken field if non-nil, zero value otherwise. ### GetFcmTokenOk `func (o *UpdateSourceDevice200Response) GetFcmTokenOk() (*string, bool)` GetFcmTokenOk returns a tuple with the FcmToken field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetFcmToken `func (o *UpdateSourceDevice200Response) SetFcmToken(v string)` SetFcmToken sets FcmToken field to given value. ### GetId `func (o *UpdateSourceDevice200Response) GetId() string` GetId returns the Id field if non-nil, zero value otherwise. ### GetIdOk `func (o *UpdateSourceDevice200Response) GetIdOk() (*string, bool)` GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetId `func (o *UpdateSourceDevice200Response) SetId(v string)` SetId sets Id field to given value. ### GetInstallId `func (o *UpdateSourceDevice200Response) GetInstallId() string` GetInstallId returns the InstallId field if non-nil, zero value otherwise. ### GetInstallIdOk `func (o *UpdateSourceDevice200Response) GetInstallIdOk() (*string, bool)` GetInstallIdOk returns a tuple with the InstallId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetInstallId `func (o *UpdateSourceDevice200Response) SetInstallId(v string)` SetInstallId sets InstallId field to given value. ### GetKey `func (o *UpdateSourceDevice200Response) GetKey() string` GetKey returns the Key field if non-nil, zero value otherwise. ### GetKeyOk `func (o *UpdateSourceDevice200Response) GetKeyOk() (*string, bool)` GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetKey `func (o *UpdateSourceDevice200Response) SetKey(v string)` SetKey sets Key field to given value. ### GetLocale `func (o *UpdateSourceDevice200Response) GetLocale() string` GetLocale returns the Locale field if non-nil, zero value otherwise. ### GetLocaleOk `func (o *UpdateSourceDevice200Response) GetLocaleOk() (*string, bool)` GetLocaleOk returns a tuple with the Locale field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetLocale `func (o *UpdateSourceDevice200Response) SetLocale(v string)` SetLocale sets Locale field to given value. ### GetModel `func (o *UpdateSourceDevice200Response) GetModel() string` GetModel returns the Model field if non-nil, zero value otherwise. ### GetModelOk `func (o *UpdateSourceDevice200Response) GetModelOk() (*string, bool)` GetModelOk returns a tuple with the Model field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetModel `func (o *UpdateSourceDevice200Response) SetModel(v string)` SetModel sets Model field to given value. ### GetName `func (o *UpdateSourceDevice200Response) GetName() string` GetName returns the Name field if non-nil, zero value otherwise. ### GetNameOk `func (o *UpdateSourceDevice200Response) GetNameOk() (*string, bool)` GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetName `func (o *UpdateSourceDevice200Response) SetName(v string)` SetName sets Name field to given value. ### GetPlace `func (o *UpdateSourceDevice200Response) GetPlace() float32` GetPlace returns the Place field if non-nil, zero value otherwise. ### GetPlaceOk `func (o *UpdateSourceDevice200Response) GetPlaceOk() (*float32, bool)` GetPlaceOk returns a tuple with the Place field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetPlace `func (o *UpdateSourceDevice200Response) SetPlace(v float32)` SetPlace sets Place field to given value. ### GetTos `func (o *UpdateSourceDevice200Response) GetTos() string` GetTos returns the Tos field if non-nil, zero value otherwise. ### GetTosOk `func (o *UpdateSourceDevice200Response) GetTosOk() (*string, bool)` GetTosOk returns a tuple with the Tos field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTos `func (o *UpdateSourceDevice200Response) SetTos(v string)` SetTos sets Tos field to given value. ### GetType `func (o *UpdateSourceDevice200Response) GetType() string` GetType returns the Type field if non-nil, zero value otherwise. ### GetTypeOk `func (o *UpdateSourceDevice200Response) GetTypeOk() (*string, bool)` GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetType `func (o *UpdateSourceDevice200Response) SetType(v string)` SetType sets Type field to given value. ### GetUpdated `func (o *UpdateSourceDevice200Response) GetUpdated() string` GetUpdated returns the Updated field if non-nil, zero value otherwise. ### GetUpdatedOk `func (o *UpdateSourceDevice200Response) GetUpdatedOk() (*string, bool)` GetUpdatedOk returns a tuple with the Updated field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetUpdated `func (o *UpdateSourceDevice200Response) SetUpdated(v string)` SetUpdated sets Updated field to given value. ### GetWaitlistEnabled `func (o *UpdateSourceDevice200Response) GetWaitlistEnabled() bool` GetWaitlistEnabled returns the WaitlistEnabled field if non-nil, zero value otherwise. ### GetWaitlistEnabledOk `func (o *UpdateSourceDevice200Response) GetWaitlistEnabledOk() (*bool, bool)` GetWaitlistEnabledOk returns a tuple with the WaitlistEnabled field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetWaitlistEnabled `func (o *UpdateSourceDevice200Response) SetWaitlistEnabled(v bool)` SetWaitlistEnabled sets WaitlistEnabled field to given value. ### GetWarpEnabled `func (o *UpdateSourceDevice200Response) GetWarpEnabled() bool` GetWarpEnabled returns the WarpEnabled field if non-nil, zero value otherwise. ### GetWarpEnabledOk `func (o *UpdateSourceDevice200Response) GetWarpEnabledOk() (*bool, bool)` GetWarpEnabledOk returns a tuple with the WarpEnabled field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetWarpEnabled `func (o *UpdateSourceDevice200Response) SetWarpEnabled(v bool)` SetWarpEnabled sets WarpEnabled field to given value. ### GetAccount `func (o *UpdateSourceDevice200Response) GetAccount() Account` GetAccount returns the Account field if non-nil, zero value otherwise. ### GetAccountOk `func (o *UpdateSourceDevice200Response) GetAccountOk() (*Account, bool)` GetAccountOk returns a tuple with the Account field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetAccount `func (o *UpdateSourceDevice200Response) SetAccount(v Account)` SetAccount sets Account field to given value. ### GetConfig `func (o *UpdateSourceDevice200Response) GetConfig() Config` GetConfig returns the Config field if non-nil, zero value otherwise. ### GetConfigOk `func (o *UpdateSourceDevice200Response) GetConfigOk() (*Config, bool)` GetConfigOk returns a tuple with the Config field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetConfig `func (o *UpdateSourceDevice200Response) SetConfig(v Config)` SetConfig sets Config field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/docs/UpdateSourceDeviceRequest.md ================================================ # UpdateSourceDeviceRequest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Key** | **string** | | ## Methods ### NewUpdateSourceDeviceRequest `func NewUpdateSourceDeviceRequest(key string, ) *UpdateSourceDeviceRequest` NewUpdateSourceDeviceRequest instantiates a new UpdateSourceDeviceRequest object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed ### NewUpdateSourceDeviceRequestWithDefaults `func NewUpdateSourceDeviceRequestWithDefaults() *UpdateSourceDeviceRequest` NewUpdateSourceDeviceRequestWithDefaults instantiates a new UpdateSourceDeviceRequest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetKey `func (o *UpdateSourceDeviceRequest) GetKey() string` GetKey returns the Key field if non-nil, zero value otherwise. ### GetKeyOk `func (o *UpdateSourceDeviceRequest) GetKeyOk() (*string, bool)` GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetKey `func (o *UpdateSourceDeviceRequest) SetKey(v string)` SetKey sets Key field to given value. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ================================================ FILE: openapi/git_push.sh ================================================ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # # Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 git_host=$4 if [ "$git_host" = "" ]; then git_host="github.com" echo "[INFO] No command line input provided. Set \$git_host to $git_host" fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" fi if [ "$git_repo_id" = "" ]; then git_repo_id="GIT_REPO_ID" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" fi if [ "$release_note" = "" ]; then release_note="Minor update" echo "[INFO] No command line input provided. Set \$release_note to $release_note" fi # Initialize the local directory as a Git repository git init # Adds the files in the local repository and stages them for commit. git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote git_remote=$(git remote) if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git fi fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' ================================================ FILE: openapi/go.mod ================================================ module github.com/GIT_USER_ID/GIT_REPO_ID go 1.18 require ( ) ================================================ FILE: openapi/go.sum ================================================ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 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= ================================================ FILE: openapi/model_account.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the Account type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Account{} // Account struct for Account type Account struct { AccountType string `json:"account_type"` Created string `json:"created"` Id string `json:"id"` License string `json:"license"` PremiumData float32 `json:"premium_data"` Quota float32 `json:"quota"` ReferralCount float32 `json:"referral_count"` ReferralRenewalCountdown float32 `json:"referral_renewal_countdown"` Role string `json:"role"` Updated string `json:"updated"` WarpPlus bool `json:"warp_plus"` Usage *float32 `json:"usage,omitempty"` AdditionalProperties map[string]interface{} } type _Account Account // NewAccount instantiates a new Account object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewAccount(accountType string, created string, id string, license string, premiumData float32, quota float32, referralCount float32, referralRenewalCountdown float32, role string, updated string, warpPlus bool) *Account { this := Account{} this.AccountType = accountType this.Created = created this.Id = id this.License = license this.PremiumData = premiumData this.Quota = quota this.ReferralCount = referralCount this.ReferralRenewalCountdown = referralRenewalCountdown this.Role = role this.Updated = updated this.WarpPlus = warpPlus return &this } // NewAccountWithDefaults instantiates a new Account object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewAccountWithDefaults() *Account { this := Account{} return &this } // GetAccountType returns the AccountType field value func (o *Account) GetAccountType() string { if o == nil { var ret string return ret } return o.AccountType } // GetAccountTypeOk returns a tuple with the AccountType field value // and a boolean to check if the value has been set. func (o *Account) GetAccountTypeOk() (*string, bool) { if o == nil { return nil, false } return &o.AccountType, true } // SetAccountType sets field value func (o *Account) SetAccountType(v string) { o.AccountType = v } // GetCreated returns the Created field value func (o *Account) GetCreated() string { if o == nil { var ret string return ret } return o.Created } // GetCreatedOk returns a tuple with the Created field value // and a boolean to check if the value has been set. func (o *Account) GetCreatedOk() (*string, bool) { if o == nil { return nil, false } return &o.Created, true } // SetCreated sets field value func (o *Account) SetCreated(v string) { o.Created = v } // GetId returns the Id field value func (o *Account) GetId() string { if o == nil { var ret string return ret } return o.Id } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *Account) GetIdOk() (*string, bool) { if o == nil { return nil, false } return &o.Id, true } // SetId sets field value func (o *Account) SetId(v string) { o.Id = v } // GetLicense returns the License field value func (o *Account) GetLicense() string { if o == nil { var ret string return ret } return o.License } // GetLicenseOk returns a tuple with the License field value // and a boolean to check if the value has been set. func (o *Account) GetLicenseOk() (*string, bool) { if o == nil { return nil, false } return &o.License, true } // SetLicense sets field value func (o *Account) SetLicense(v string) { o.License = v } // GetPremiumData returns the PremiumData field value func (o *Account) GetPremiumData() float32 { if o == nil { var ret float32 return ret } return o.PremiumData } // GetPremiumDataOk returns a tuple with the PremiumData field value // and a boolean to check if the value has been set. func (o *Account) GetPremiumDataOk() (*float32, bool) { if o == nil { return nil, false } return &o.PremiumData, true } // SetPremiumData sets field value func (o *Account) SetPremiumData(v float32) { o.PremiumData = v } // GetQuota returns the Quota field value func (o *Account) GetQuota() float32 { if o == nil { var ret float32 return ret } return o.Quota } // GetQuotaOk returns a tuple with the Quota field value // and a boolean to check if the value has been set. func (o *Account) GetQuotaOk() (*float32, bool) { if o == nil { return nil, false } return &o.Quota, true } // SetQuota sets field value func (o *Account) SetQuota(v float32) { o.Quota = v } // GetReferralCount returns the ReferralCount field value func (o *Account) GetReferralCount() float32 { if o == nil { var ret float32 return ret } return o.ReferralCount } // GetReferralCountOk returns a tuple with the ReferralCount field value // and a boolean to check if the value has been set. func (o *Account) GetReferralCountOk() (*float32, bool) { if o == nil { return nil, false } return &o.ReferralCount, true } // SetReferralCount sets field value func (o *Account) SetReferralCount(v float32) { o.ReferralCount = v } // GetReferralRenewalCountdown returns the ReferralRenewalCountdown field value func (o *Account) GetReferralRenewalCountdown() float32 { if o == nil { var ret float32 return ret } return o.ReferralRenewalCountdown } // GetReferralRenewalCountdownOk returns a tuple with the ReferralRenewalCountdown field value // and a boolean to check if the value has been set. func (o *Account) GetReferralRenewalCountdownOk() (*float32, bool) { if o == nil { return nil, false } return &o.ReferralRenewalCountdown, true } // SetReferralRenewalCountdown sets field value func (o *Account) SetReferralRenewalCountdown(v float32) { o.ReferralRenewalCountdown = v } // GetRole returns the Role field value func (o *Account) GetRole() string { if o == nil { var ret string return ret } return o.Role } // GetRoleOk returns a tuple with the Role field value // and a boolean to check if the value has been set. func (o *Account) GetRoleOk() (*string, bool) { if o == nil { return nil, false } return &o.Role, true } // SetRole sets field value func (o *Account) SetRole(v string) { o.Role = v } // GetUpdated returns the Updated field value func (o *Account) GetUpdated() string { if o == nil { var ret string return ret } return o.Updated } // GetUpdatedOk returns a tuple with the Updated field value // and a boolean to check if the value has been set. func (o *Account) GetUpdatedOk() (*string, bool) { if o == nil { return nil, false } return &o.Updated, true } // SetUpdated sets field value func (o *Account) SetUpdated(v string) { o.Updated = v } // GetWarpPlus returns the WarpPlus field value func (o *Account) GetWarpPlus() bool { if o == nil { var ret bool return ret } return o.WarpPlus } // GetWarpPlusOk returns a tuple with the WarpPlus field value // and a boolean to check if the value has been set. func (o *Account) GetWarpPlusOk() (*bool, bool) { if o == nil { return nil, false } return &o.WarpPlus, true } // SetWarpPlus sets field value func (o *Account) SetWarpPlus(v bool) { o.WarpPlus = v } // GetUsage returns the Usage field value if set, zero value otherwise. func (o *Account) GetUsage() float32 { if o == nil || IsNil(o.Usage) { var ret float32 return ret } return *o.Usage } // GetUsageOk returns a tuple with the Usage field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Account) GetUsageOk() (*float32, bool) { if o == nil || IsNil(o.Usage) { return nil, false } return o.Usage, true } // HasUsage returns a boolean if a field has been set. func (o *Account) HasUsage() bool { if o != nil && !IsNil(o.Usage) { return true } return false } // SetUsage gets a reference to the given float32 and assigns it to the Usage field. func (o *Account) SetUsage(v float32) { o.Usage = &v } func (o Account) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o Account) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["account_type"] = o.AccountType toSerialize["created"] = o.Created toSerialize["id"] = o.Id toSerialize["license"] = o.License toSerialize["premium_data"] = o.PremiumData toSerialize["quota"] = o.Quota toSerialize["referral_count"] = o.ReferralCount toSerialize["referral_renewal_countdown"] = o.ReferralRenewalCountdown toSerialize["role"] = o.Role toSerialize["updated"] = o.Updated toSerialize["warp_plus"] = o.WarpPlus if !IsNil(o.Usage) { toSerialize["usage"] = o.Usage } for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *Account) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "account_type", "created", "id", "license", "premium_data", "quota", "referral_count", "referral_renewal_countdown", "role", "updated", "warp_plus", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varAccount := _Account{} err = json.Unmarshal(data, &varAccount) if err != nil { return err } *o = Account(varAccount) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "account_type") delete(additionalProperties, "created") delete(additionalProperties, "id") delete(additionalProperties, "license") delete(additionalProperties, "premium_data") delete(additionalProperties, "quota") delete(additionalProperties, "referral_count") delete(additionalProperties, "referral_renewal_countdown") delete(additionalProperties, "role") delete(additionalProperties, "updated") delete(additionalProperties, "warp_plus") delete(additionalProperties, "usage") o.AdditionalProperties = additionalProperties } return err } type NullableAccount struct { value *Account isSet bool } func (v NullableAccount) Get() *Account { return v.value } func (v *NullableAccount) Set(val *Account) { v.value = val v.isSet = true } func (v NullableAccount) IsSet() bool { return v.isSet } func (v *NullableAccount) Unset() { v.value = nil v.isSet = false } func NewNullableAccount(val *Account) *NullableAccount { return &NullableAccount{value: val, isSet: true} } func (v NullableAccount) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableAccount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_bound_device.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the BoundDevice type satisfies the MappedNullable interface at compile time var _ MappedNullable = &BoundDevice{} // BoundDevice struct for BoundDevice type BoundDevice struct { Activated string `json:"activated"` Active bool `json:"active"` Created string `json:"created"` Id string `json:"id"` Model string `json:"model"` Name *string `json:"name,omitempty"` Role string `json:"role"` Type string `json:"type"` AdditionalProperties map[string]interface{} } type _BoundDevice BoundDevice // NewBoundDevice instantiates a new BoundDevice object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewBoundDevice(activated string, active bool, created string, id string, model string, role string, type_ string) *BoundDevice { this := BoundDevice{} this.Activated = activated this.Active = active this.Created = created this.Id = id this.Model = model this.Role = role this.Type = type_ return &this } // NewBoundDeviceWithDefaults instantiates a new BoundDevice object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewBoundDeviceWithDefaults() *BoundDevice { this := BoundDevice{} return &this } // GetActivated returns the Activated field value func (o *BoundDevice) GetActivated() string { if o == nil { var ret string return ret } return o.Activated } // GetActivatedOk returns a tuple with the Activated field value // and a boolean to check if the value has been set. func (o *BoundDevice) GetActivatedOk() (*string, bool) { if o == nil { return nil, false } return &o.Activated, true } // SetActivated sets field value func (o *BoundDevice) SetActivated(v string) { o.Activated = v } // GetActive returns the Active field value func (o *BoundDevice) GetActive() bool { if o == nil { var ret bool return ret } return o.Active } // GetActiveOk returns a tuple with the Active field value // and a boolean to check if the value has been set. func (o *BoundDevice) GetActiveOk() (*bool, bool) { if o == nil { return nil, false } return &o.Active, true } // SetActive sets field value func (o *BoundDevice) SetActive(v bool) { o.Active = v } // GetCreated returns the Created field value func (o *BoundDevice) GetCreated() string { if o == nil { var ret string return ret } return o.Created } // GetCreatedOk returns a tuple with the Created field value // and a boolean to check if the value has been set. func (o *BoundDevice) GetCreatedOk() (*string, bool) { if o == nil { return nil, false } return &o.Created, true } // SetCreated sets field value func (o *BoundDevice) SetCreated(v string) { o.Created = v } // GetId returns the Id field value func (o *BoundDevice) GetId() string { if o == nil { var ret string return ret } return o.Id } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *BoundDevice) GetIdOk() (*string, bool) { if o == nil { return nil, false } return &o.Id, true } // SetId sets field value func (o *BoundDevice) SetId(v string) { o.Id = v } // GetModel returns the Model field value func (o *BoundDevice) GetModel() string { if o == nil { var ret string return ret } return o.Model } // GetModelOk returns a tuple with the Model field value // and a boolean to check if the value has been set. func (o *BoundDevice) GetModelOk() (*string, bool) { if o == nil { return nil, false } return &o.Model, true } // SetModel sets field value func (o *BoundDevice) SetModel(v string) { o.Model = v } // GetName returns the Name field value if set, zero value otherwise. func (o *BoundDevice) GetName() string { if o == nil || IsNil(o.Name) { var ret string return ret } return *o.Name } // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *BoundDevice) GetNameOk() (*string, bool) { if o == nil || IsNil(o.Name) { return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *BoundDevice) HasName() bool { if o != nil && !IsNil(o.Name) { return true } return false } // SetName gets a reference to the given string and assigns it to the Name field. func (o *BoundDevice) SetName(v string) { o.Name = &v } // GetRole returns the Role field value func (o *BoundDevice) GetRole() string { if o == nil { var ret string return ret } return o.Role } // GetRoleOk returns a tuple with the Role field value // and a boolean to check if the value has been set. func (o *BoundDevice) GetRoleOk() (*string, bool) { if o == nil { return nil, false } return &o.Role, true } // SetRole sets field value func (o *BoundDevice) SetRole(v string) { o.Role = v } // GetType returns the Type field value func (o *BoundDevice) GetType() string { if o == nil { var ret string return ret } return o.Type } // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *BoundDevice) GetTypeOk() (*string, bool) { if o == nil { return nil, false } return &o.Type, true } // SetType sets field value func (o *BoundDevice) SetType(v string) { o.Type = v } func (o BoundDevice) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o BoundDevice) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["activated"] = o.Activated toSerialize["active"] = o.Active toSerialize["created"] = o.Created toSerialize["id"] = o.Id toSerialize["model"] = o.Model if !IsNil(o.Name) { toSerialize["name"] = o.Name } toSerialize["role"] = o.Role toSerialize["type"] = o.Type for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *BoundDevice) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "activated", "active", "created", "id", "model", "role", "type", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varBoundDevice := _BoundDevice{} err = json.Unmarshal(data, &varBoundDevice) if err != nil { return err } *o = BoundDevice(varBoundDevice) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "activated") delete(additionalProperties, "active") delete(additionalProperties, "created") delete(additionalProperties, "id") delete(additionalProperties, "model") delete(additionalProperties, "name") delete(additionalProperties, "role") delete(additionalProperties, "type") o.AdditionalProperties = additionalProperties } return err } type NullableBoundDevice struct { value *BoundDevice isSet bool } func (v NullableBoundDevice) Get() *BoundDevice { return v.value } func (v *NullableBoundDevice) Set(val *BoundDevice) { v.value = val v.isSet = true } func (v NullableBoundDevice) IsSet() bool { return v.isSet } func (v *NullableBoundDevice) Unset() { v.value = nil v.isSet = false } func NewNullableBoundDevice(val *BoundDevice) *NullableBoundDevice { return &NullableBoundDevice{value: val, isSet: true} } func (v NullableBoundDevice) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableBoundDevice) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_config.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the Config type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Config{} // Config struct for Config type Config struct { ClientId string `json:"client_id"` Interface ConfigInterface `json:"interface"` Peers []Peer `json:"peers"` Services ConfigServices `json:"services"` AdditionalProperties map[string]interface{} } type _Config Config // NewConfig instantiates a new Config object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewConfig(clientId string, interface_ ConfigInterface, peers []Peer, services ConfigServices) *Config { this := Config{} this.ClientId = clientId this.Interface = interface_ this.Peers = peers this.Services = services return &this } // NewConfigWithDefaults instantiates a new Config object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewConfigWithDefaults() *Config { this := Config{} return &this } // GetClientId returns the ClientId field value func (o *Config) GetClientId() string { if o == nil { var ret string return ret } return o.ClientId } // GetClientIdOk returns a tuple with the ClientId field value // and a boolean to check if the value has been set. func (o *Config) GetClientIdOk() (*string, bool) { if o == nil { return nil, false } return &o.ClientId, true } // SetClientId sets field value func (o *Config) SetClientId(v string) { o.ClientId = v } // GetInterface returns the Interface field value func (o *Config) GetInterface() ConfigInterface { if o == nil { var ret ConfigInterface return ret } return o.Interface } // GetInterfaceOk returns a tuple with the Interface field value // and a boolean to check if the value has been set. func (o *Config) GetInterfaceOk() (*ConfigInterface, bool) { if o == nil { return nil, false } return &o.Interface, true } // SetInterface sets field value func (o *Config) SetInterface(v ConfigInterface) { o.Interface = v } // GetPeers returns the Peers field value func (o *Config) GetPeers() []Peer { if o == nil { var ret []Peer return ret } return o.Peers } // GetPeersOk returns a tuple with the Peers field value // and a boolean to check if the value has been set. func (o *Config) GetPeersOk() ([]Peer, bool) { if o == nil { return nil, false } return o.Peers, true } // SetPeers sets field value func (o *Config) SetPeers(v []Peer) { o.Peers = v } // GetServices returns the Services field value func (o *Config) GetServices() ConfigServices { if o == nil { var ret ConfigServices return ret } return o.Services } // GetServicesOk returns a tuple with the Services field value // and a boolean to check if the value has been set. func (o *Config) GetServicesOk() (*ConfigServices, bool) { if o == nil { return nil, false } return &o.Services, true } // SetServices sets field value func (o *Config) SetServices(v ConfigServices) { o.Services = v } func (o Config) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o Config) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["client_id"] = o.ClientId toSerialize["interface"] = o.Interface toSerialize["peers"] = o.Peers toSerialize["services"] = o.Services for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *Config) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "client_id", "interface", "peers", "services", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varConfig := _Config{} err = json.Unmarshal(data, &varConfig) if err != nil { return err } *o = Config(varConfig) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "client_id") delete(additionalProperties, "interface") delete(additionalProperties, "peers") delete(additionalProperties, "services") o.AdditionalProperties = additionalProperties } return err } type NullableConfig struct { value *Config isSet bool } func (v NullableConfig) Get() *Config { return v.value } func (v *NullableConfig) Set(val *Config) { v.value = val v.isSet = true } func (v NullableConfig) IsSet() bool { return v.isSet } func (v *NullableConfig) Unset() { v.value = nil v.isSet = false } func NewNullableConfig(val *Config) *NullableConfig { return &NullableConfig{value: val, isSet: true} } func (v NullableConfig) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableConfig) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_config_interface.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the ConfigInterface type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ConfigInterface{} // ConfigInterface struct for ConfigInterface type ConfigInterface struct { Addresses NetworkAddress `json:"addresses"` AdditionalProperties map[string]interface{} } type _ConfigInterface ConfigInterface // NewConfigInterface instantiates a new ConfigInterface object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewConfigInterface(addresses NetworkAddress) *ConfigInterface { this := ConfigInterface{} this.Addresses = addresses return &this } // NewConfigInterfaceWithDefaults instantiates a new ConfigInterface object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewConfigInterfaceWithDefaults() *ConfigInterface { this := ConfigInterface{} return &this } // GetAddresses returns the Addresses field value func (o *ConfigInterface) GetAddresses() NetworkAddress { if o == nil { var ret NetworkAddress return ret } return o.Addresses } // GetAddressesOk returns a tuple with the Addresses field value // and a boolean to check if the value has been set. func (o *ConfigInterface) GetAddressesOk() (*NetworkAddress, bool) { if o == nil { return nil, false } return &o.Addresses, true } // SetAddresses sets field value func (o *ConfigInterface) SetAddresses(v NetworkAddress) { o.Addresses = v } func (o ConfigInterface) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o ConfigInterface) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["addresses"] = o.Addresses for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *ConfigInterface) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "addresses", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varConfigInterface := _ConfigInterface{} err = json.Unmarshal(data, &varConfigInterface) if err != nil { return err } *o = ConfigInterface(varConfigInterface) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "addresses") o.AdditionalProperties = additionalProperties } return err } type NullableConfigInterface struct { value *ConfigInterface isSet bool } func (v NullableConfigInterface) Get() *ConfigInterface { return v.value } func (v *NullableConfigInterface) Set(val *ConfigInterface) { v.value = val v.isSet = true } func (v NullableConfigInterface) IsSet() bool { return v.isSet } func (v *NullableConfigInterface) Unset() { v.value = nil v.isSet = false } func NewNullableConfigInterface(val *ConfigInterface) *NullableConfigInterface { return &NullableConfigInterface{value: val, isSet: true} } func (v NullableConfigInterface) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableConfigInterface) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_config_services.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the ConfigServices type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ConfigServices{} // ConfigServices struct for ConfigServices type ConfigServices struct { HttpProxy string `json:"http_proxy"` AdditionalProperties map[string]interface{} } type _ConfigServices ConfigServices // NewConfigServices instantiates a new ConfigServices object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewConfigServices(httpProxy string) *ConfigServices { this := ConfigServices{} this.HttpProxy = httpProxy return &this } // NewConfigServicesWithDefaults instantiates a new ConfigServices object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewConfigServicesWithDefaults() *ConfigServices { this := ConfigServices{} return &this } // GetHttpProxy returns the HttpProxy field value func (o *ConfigServices) GetHttpProxy() string { if o == nil { var ret string return ret } return o.HttpProxy } // GetHttpProxyOk returns a tuple with the HttpProxy field value // and a boolean to check if the value has been set. func (o *ConfigServices) GetHttpProxyOk() (*string, bool) { if o == nil { return nil, false } return &o.HttpProxy, true } // SetHttpProxy sets field value func (o *ConfigServices) SetHttpProxy(v string) { o.HttpProxy = v } func (o ConfigServices) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o ConfigServices) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["http_proxy"] = o.HttpProxy for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *ConfigServices) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "http_proxy", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varConfigServices := _ConfigServices{} err = json.Unmarshal(data, &varConfigServices) if err != nil { return err } *o = ConfigServices(varConfigServices) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "http_proxy") o.AdditionalProperties = additionalProperties } return err } type NullableConfigServices struct { value *ConfigServices isSet bool } func (v NullableConfigServices) Get() *ConfigServices { return v.value } func (v *NullableConfigServices) Set(val *ConfigServices) { v.value = val v.isSet = true } func (v NullableConfigServices) IsSet() bool { return v.isSet } func (v *NullableConfigServices) Unset() { v.value = nil v.isSet = false } func NewNullableConfigServices(val *ConfigServices) *NullableConfigServices { return &NullableConfigServices{value: val, isSet: true} } func (v NullableConfigServices) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableConfigServices) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_endpoint.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the Endpoint type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Endpoint{} // Endpoint struct for Endpoint type Endpoint struct { Host string `json:"host"` V4 string `json:"v4"` V6 string `json:"v6"` AdditionalProperties map[string]interface{} } type _Endpoint Endpoint // NewEndpoint instantiates a new Endpoint object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewEndpoint(host string, v4 string, v6 string) *Endpoint { this := Endpoint{} this.Host = host this.V4 = v4 this.V6 = v6 return &this } // NewEndpointWithDefaults instantiates a new Endpoint object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewEndpointWithDefaults() *Endpoint { this := Endpoint{} return &this } // GetHost returns the Host field value func (o *Endpoint) GetHost() string { if o == nil { var ret string return ret } return o.Host } // GetHostOk returns a tuple with the Host field value // and a boolean to check if the value has been set. func (o *Endpoint) GetHostOk() (*string, bool) { if o == nil { return nil, false } return &o.Host, true } // SetHost sets field value func (o *Endpoint) SetHost(v string) { o.Host = v } // GetV4 returns the V4 field value func (o *Endpoint) GetV4() string { if o == nil { var ret string return ret } return o.V4 } // GetV4Ok returns a tuple with the V4 field value // and a boolean to check if the value has been set. func (o *Endpoint) GetV4Ok() (*string, bool) { if o == nil { return nil, false } return &o.V4, true } // SetV4 sets field value func (o *Endpoint) SetV4(v string) { o.V4 = v } // GetV6 returns the V6 field value func (o *Endpoint) GetV6() string { if o == nil { var ret string return ret } return o.V6 } // GetV6Ok returns a tuple with the V6 field value // and a boolean to check if the value has been set. func (o *Endpoint) GetV6Ok() (*string, bool) { if o == nil { return nil, false } return &o.V6, true } // SetV6 sets field value func (o *Endpoint) SetV6(v string) { o.V6 = v } func (o Endpoint) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o Endpoint) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["host"] = o.Host toSerialize["v4"] = o.V4 toSerialize["v6"] = o.V6 for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *Endpoint) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "host", "v4", "v6", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varEndpoint := _Endpoint{} err = json.Unmarshal(data, &varEndpoint) if err != nil { return err } *o = Endpoint(varEndpoint) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "host") delete(additionalProperties, "v4") delete(additionalProperties, "v6") o.AdditionalProperties = additionalProperties } return err } type NullableEndpoint struct { value *Endpoint isSet bool } func (v NullableEndpoint) Get() *Endpoint { return v.value } func (v *NullableEndpoint) Set(val *Endpoint) { v.value = val v.isSet = true } func (v NullableEndpoint) IsSet() bool { return v.isSet } func (v *NullableEndpoint) Unset() { v.value = nil v.isSet = false } func NewNullableEndpoint(val *Endpoint) *NullableEndpoint { return &NullableEndpoint{value: val, isSet: true} } func (v NullableEndpoint) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableEndpoint) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_get_client_config_200_response.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the GetClientConfig200Response type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetClientConfig200Response{} // GetClientConfig200Response struct for GetClientConfig200Response type GetClientConfig200Response struct { CaptivePortal []GetClientConfig200ResponseCaptivePortalInner `json:"captive_portal"` Denylist []GetClientConfig200ResponseDenylistInner `json:"denylist"` PremiumDataBytes float32 `json:"premium_data_bytes"` ReferralRewardBytes float32 `json:"referral_reward_bytes"` AdditionalProperties map[string]interface{} } type _GetClientConfig200Response GetClientConfig200Response // NewGetClientConfig200Response instantiates a new GetClientConfig200Response object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewGetClientConfig200Response(captivePortal []GetClientConfig200ResponseCaptivePortalInner, denylist []GetClientConfig200ResponseDenylistInner, premiumDataBytes float32, referralRewardBytes float32) *GetClientConfig200Response { this := GetClientConfig200Response{} this.CaptivePortal = captivePortal this.Denylist = denylist this.PremiumDataBytes = premiumDataBytes this.ReferralRewardBytes = referralRewardBytes return &this } // NewGetClientConfig200ResponseWithDefaults instantiates a new GetClientConfig200Response object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewGetClientConfig200ResponseWithDefaults() *GetClientConfig200Response { this := GetClientConfig200Response{} return &this } // GetCaptivePortal returns the CaptivePortal field value func (o *GetClientConfig200Response) GetCaptivePortal() []GetClientConfig200ResponseCaptivePortalInner { if o == nil { var ret []GetClientConfig200ResponseCaptivePortalInner return ret } return o.CaptivePortal } // GetCaptivePortalOk returns a tuple with the CaptivePortal field value // and a boolean to check if the value has been set. func (o *GetClientConfig200Response) GetCaptivePortalOk() ([]GetClientConfig200ResponseCaptivePortalInner, bool) { if o == nil { return nil, false } return o.CaptivePortal, true } // SetCaptivePortal sets field value func (o *GetClientConfig200Response) SetCaptivePortal(v []GetClientConfig200ResponseCaptivePortalInner) { o.CaptivePortal = v } // GetDenylist returns the Denylist field value func (o *GetClientConfig200Response) GetDenylist() []GetClientConfig200ResponseDenylistInner { if o == nil { var ret []GetClientConfig200ResponseDenylistInner return ret } return o.Denylist } // GetDenylistOk returns a tuple with the Denylist field value // and a boolean to check if the value has been set. func (o *GetClientConfig200Response) GetDenylistOk() ([]GetClientConfig200ResponseDenylistInner, bool) { if o == nil { return nil, false } return o.Denylist, true } // SetDenylist sets field value func (o *GetClientConfig200Response) SetDenylist(v []GetClientConfig200ResponseDenylistInner) { o.Denylist = v } // GetPremiumDataBytes returns the PremiumDataBytes field value func (o *GetClientConfig200Response) GetPremiumDataBytes() float32 { if o == nil { var ret float32 return ret } return o.PremiumDataBytes } // GetPremiumDataBytesOk returns a tuple with the PremiumDataBytes field value // and a boolean to check if the value has been set. func (o *GetClientConfig200Response) GetPremiumDataBytesOk() (*float32, bool) { if o == nil { return nil, false } return &o.PremiumDataBytes, true } // SetPremiumDataBytes sets field value func (o *GetClientConfig200Response) SetPremiumDataBytes(v float32) { o.PremiumDataBytes = v } // GetReferralRewardBytes returns the ReferralRewardBytes field value func (o *GetClientConfig200Response) GetReferralRewardBytes() float32 { if o == nil { var ret float32 return ret } return o.ReferralRewardBytes } // GetReferralRewardBytesOk returns a tuple with the ReferralRewardBytes field value // and a boolean to check if the value has been set. func (o *GetClientConfig200Response) GetReferralRewardBytesOk() (*float32, bool) { if o == nil { return nil, false } return &o.ReferralRewardBytes, true } // SetReferralRewardBytes sets field value func (o *GetClientConfig200Response) SetReferralRewardBytes(v float32) { o.ReferralRewardBytes = v } func (o GetClientConfig200Response) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o GetClientConfig200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["captive_portal"] = o.CaptivePortal toSerialize["denylist"] = o.Denylist toSerialize["premium_data_bytes"] = o.PremiumDataBytes toSerialize["referral_reward_bytes"] = o.ReferralRewardBytes for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *GetClientConfig200Response) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "captive_portal", "denylist", "premium_data_bytes", "referral_reward_bytes", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varGetClientConfig200Response := _GetClientConfig200Response{} err = json.Unmarshal(data, &varGetClientConfig200Response) if err != nil { return err } *o = GetClientConfig200Response(varGetClientConfig200Response) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "captive_portal") delete(additionalProperties, "denylist") delete(additionalProperties, "premium_data_bytes") delete(additionalProperties, "referral_reward_bytes") o.AdditionalProperties = additionalProperties } return err } type NullableGetClientConfig200Response struct { value *GetClientConfig200Response isSet bool } func (v NullableGetClientConfig200Response) Get() *GetClientConfig200Response { return v.value } func (v *NullableGetClientConfig200Response) Set(val *GetClientConfig200Response) { v.value = val v.isSet = true } func (v NullableGetClientConfig200Response) IsSet() bool { return v.isSet } func (v *NullableGetClientConfig200Response) Unset() { v.value = nil v.isSet = false } func NewNullableGetClientConfig200Response(val *GetClientConfig200Response) *NullableGetClientConfig200Response { return &NullableGetClientConfig200Response{value: val, isSet: true} } func (v NullableGetClientConfig200Response) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableGetClientConfig200Response) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_get_client_config_200_response_captive_portal_inner.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the GetClientConfig200ResponseCaptivePortalInner type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetClientConfig200ResponseCaptivePortalInner{} // GetClientConfig200ResponseCaptivePortalInner struct for GetClientConfig200ResponseCaptivePortalInner type GetClientConfig200ResponseCaptivePortalInner struct { Name string `json:"name"` Networks []GetClientConfig200ResponseCaptivePortalInnerNetworksInner `json:"networks"` AdditionalProperties map[string]interface{} } type _GetClientConfig200ResponseCaptivePortalInner GetClientConfig200ResponseCaptivePortalInner // NewGetClientConfig200ResponseCaptivePortalInner instantiates a new GetClientConfig200ResponseCaptivePortalInner object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewGetClientConfig200ResponseCaptivePortalInner(name string, networks []GetClientConfig200ResponseCaptivePortalInnerNetworksInner) *GetClientConfig200ResponseCaptivePortalInner { this := GetClientConfig200ResponseCaptivePortalInner{} this.Name = name this.Networks = networks return &this } // NewGetClientConfig200ResponseCaptivePortalInnerWithDefaults instantiates a new GetClientConfig200ResponseCaptivePortalInner object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewGetClientConfig200ResponseCaptivePortalInnerWithDefaults() *GetClientConfig200ResponseCaptivePortalInner { this := GetClientConfig200ResponseCaptivePortalInner{} return &this } // GetName returns the Name field value func (o *GetClientConfig200ResponseCaptivePortalInner) GetName() string { if o == nil { var ret string return ret } return o.Name } // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *GetClientConfig200ResponseCaptivePortalInner) GetNameOk() (*string, bool) { if o == nil { return nil, false } return &o.Name, true } // SetName sets field value func (o *GetClientConfig200ResponseCaptivePortalInner) SetName(v string) { o.Name = v } // GetNetworks returns the Networks field value func (o *GetClientConfig200ResponseCaptivePortalInner) GetNetworks() []GetClientConfig200ResponseCaptivePortalInnerNetworksInner { if o == nil { var ret []GetClientConfig200ResponseCaptivePortalInnerNetworksInner return ret } return o.Networks } // GetNetworksOk returns a tuple with the Networks field value // and a boolean to check if the value has been set. func (o *GetClientConfig200ResponseCaptivePortalInner) GetNetworksOk() ([]GetClientConfig200ResponseCaptivePortalInnerNetworksInner, bool) { if o == nil { return nil, false } return o.Networks, true } // SetNetworks sets field value func (o *GetClientConfig200ResponseCaptivePortalInner) SetNetworks(v []GetClientConfig200ResponseCaptivePortalInnerNetworksInner) { o.Networks = v } func (o GetClientConfig200ResponseCaptivePortalInner) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o GetClientConfig200ResponseCaptivePortalInner) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["name"] = o.Name toSerialize["networks"] = o.Networks for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *GetClientConfig200ResponseCaptivePortalInner) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "name", "networks", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varGetClientConfig200ResponseCaptivePortalInner := _GetClientConfig200ResponseCaptivePortalInner{} err = json.Unmarshal(data, &varGetClientConfig200ResponseCaptivePortalInner) if err != nil { return err } *o = GetClientConfig200ResponseCaptivePortalInner(varGetClientConfig200ResponseCaptivePortalInner) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "name") delete(additionalProperties, "networks") o.AdditionalProperties = additionalProperties } return err } type NullableGetClientConfig200ResponseCaptivePortalInner struct { value *GetClientConfig200ResponseCaptivePortalInner isSet bool } func (v NullableGetClientConfig200ResponseCaptivePortalInner) Get() *GetClientConfig200ResponseCaptivePortalInner { return v.value } func (v *NullableGetClientConfig200ResponseCaptivePortalInner) Set(val *GetClientConfig200ResponseCaptivePortalInner) { v.value = val v.isSet = true } func (v NullableGetClientConfig200ResponseCaptivePortalInner) IsSet() bool { return v.isSet } func (v *NullableGetClientConfig200ResponseCaptivePortalInner) Unset() { v.value = nil v.isSet = false } func NewNullableGetClientConfig200ResponseCaptivePortalInner(val *GetClientConfig200ResponseCaptivePortalInner) *NullableGetClientConfig200ResponseCaptivePortalInner { return &NullableGetClientConfig200ResponseCaptivePortalInner{value: val, isSet: true} } func (v NullableGetClientConfig200ResponseCaptivePortalInner) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableGetClientConfig200ResponseCaptivePortalInner) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_get_client_config_200_response_captive_portal_inner_networks_inner.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the GetClientConfig200ResponseCaptivePortalInnerNetworksInner type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetClientConfig200ResponseCaptivePortalInnerNetworksInner{} // GetClientConfig200ResponseCaptivePortalInnerNetworksInner struct for GetClientConfig200ResponseCaptivePortalInnerNetworksInner type GetClientConfig200ResponseCaptivePortalInnerNetworksInner struct { Address string `json:"address"` AdditionalProperties map[string]interface{} } type _GetClientConfig200ResponseCaptivePortalInnerNetworksInner GetClientConfig200ResponseCaptivePortalInnerNetworksInner // NewGetClientConfig200ResponseCaptivePortalInnerNetworksInner instantiates a new GetClientConfig200ResponseCaptivePortalInnerNetworksInner object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewGetClientConfig200ResponseCaptivePortalInnerNetworksInner(address string) *GetClientConfig200ResponseCaptivePortalInnerNetworksInner { this := GetClientConfig200ResponseCaptivePortalInnerNetworksInner{} this.Address = address return &this } // NewGetClientConfig200ResponseCaptivePortalInnerNetworksInnerWithDefaults instantiates a new GetClientConfig200ResponseCaptivePortalInnerNetworksInner object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewGetClientConfig200ResponseCaptivePortalInnerNetworksInnerWithDefaults() *GetClientConfig200ResponseCaptivePortalInnerNetworksInner { this := GetClientConfig200ResponseCaptivePortalInnerNetworksInner{} return &this } // GetAddress returns the Address field value func (o *GetClientConfig200ResponseCaptivePortalInnerNetworksInner) GetAddress() string { if o == nil { var ret string return ret } return o.Address } // GetAddressOk returns a tuple with the Address field value // and a boolean to check if the value has been set. func (o *GetClientConfig200ResponseCaptivePortalInnerNetworksInner) GetAddressOk() (*string, bool) { if o == nil { return nil, false } return &o.Address, true } // SetAddress sets field value func (o *GetClientConfig200ResponseCaptivePortalInnerNetworksInner) SetAddress(v string) { o.Address = v } func (o GetClientConfig200ResponseCaptivePortalInnerNetworksInner) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o GetClientConfig200ResponseCaptivePortalInnerNetworksInner) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["address"] = o.Address for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *GetClientConfig200ResponseCaptivePortalInnerNetworksInner) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "address", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varGetClientConfig200ResponseCaptivePortalInnerNetworksInner := _GetClientConfig200ResponseCaptivePortalInnerNetworksInner{} err = json.Unmarshal(data, &varGetClientConfig200ResponseCaptivePortalInnerNetworksInner) if err != nil { return err } *o = GetClientConfig200ResponseCaptivePortalInnerNetworksInner(varGetClientConfig200ResponseCaptivePortalInnerNetworksInner) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "address") o.AdditionalProperties = additionalProperties } return err } type NullableGetClientConfig200ResponseCaptivePortalInnerNetworksInner struct { value *GetClientConfig200ResponseCaptivePortalInnerNetworksInner isSet bool } func (v NullableGetClientConfig200ResponseCaptivePortalInnerNetworksInner) Get() *GetClientConfig200ResponseCaptivePortalInnerNetworksInner { return v.value } func (v *NullableGetClientConfig200ResponseCaptivePortalInnerNetworksInner) Set(val *GetClientConfig200ResponseCaptivePortalInnerNetworksInner) { v.value = val v.isSet = true } func (v NullableGetClientConfig200ResponseCaptivePortalInnerNetworksInner) IsSet() bool { return v.isSet } func (v *NullableGetClientConfig200ResponseCaptivePortalInnerNetworksInner) Unset() { v.value = nil v.isSet = false } func NewNullableGetClientConfig200ResponseCaptivePortalInnerNetworksInner(val *GetClientConfig200ResponseCaptivePortalInnerNetworksInner) *NullableGetClientConfig200ResponseCaptivePortalInnerNetworksInner { return &NullableGetClientConfig200ResponseCaptivePortalInnerNetworksInner{value: val, isSet: true} } func (v NullableGetClientConfig200ResponseCaptivePortalInnerNetworksInner) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableGetClientConfig200ResponseCaptivePortalInnerNetworksInner) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_get_client_config_200_response_denylist_inner.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the GetClientConfig200ResponseDenylistInner type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetClientConfig200ResponseDenylistInner{} // GetClientConfig200ResponseDenylistInner struct for GetClientConfig200ResponseDenylistInner type GetClientConfig200ResponseDenylistInner struct { AndroidPackages []string `json:"android-packages,omitempty"` Name string `json:"name"` Networks *GetClientConfig200ResponseDenylistInnerNetworks `json:"networks,omitempty"` Visible bool `json:"visible"` AdditionalProperties map[string]interface{} } type _GetClientConfig200ResponseDenylistInner GetClientConfig200ResponseDenylistInner // NewGetClientConfig200ResponseDenylistInner instantiates a new GetClientConfig200ResponseDenylistInner object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewGetClientConfig200ResponseDenylistInner(name string, visible bool) *GetClientConfig200ResponseDenylistInner { this := GetClientConfig200ResponseDenylistInner{} this.Name = name this.Visible = visible return &this } // NewGetClientConfig200ResponseDenylistInnerWithDefaults instantiates a new GetClientConfig200ResponseDenylistInner object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewGetClientConfig200ResponseDenylistInnerWithDefaults() *GetClientConfig200ResponseDenylistInner { this := GetClientConfig200ResponseDenylistInner{} return &this } // GetAndroidPackages returns the AndroidPackages field value if set, zero value otherwise. func (o *GetClientConfig200ResponseDenylistInner) GetAndroidPackages() []string { if o == nil || IsNil(o.AndroidPackages) { var ret []string return ret } return o.AndroidPackages } // GetAndroidPackagesOk returns a tuple with the AndroidPackages field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *GetClientConfig200ResponseDenylistInner) GetAndroidPackagesOk() ([]string, bool) { if o == nil || IsNil(o.AndroidPackages) { return nil, false } return o.AndroidPackages, true } // HasAndroidPackages returns a boolean if a field has been set. func (o *GetClientConfig200ResponseDenylistInner) HasAndroidPackages() bool { if o != nil && !IsNil(o.AndroidPackages) { return true } return false } // SetAndroidPackages gets a reference to the given []string and assigns it to the AndroidPackages field. func (o *GetClientConfig200ResponseDenylistInner) SetAndroidPackages(v []string) { o.AndroidPackages = v } // GetName returns the Name field value func (o *GetClientConfig200ResponseDenylistInner) GetName() string { if o == nil { var ret string return ret } return o.Name } // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *GetClientConfig200ResponseDenylistInner) GetNameOk() (*string, bool) { if o == nil { return nil, false } return &o.Name, true } // SetName sets field value func (o *GetClientConfig200ResponseDenylistInner) SetName(v string) { o.Name = v } // GetNetworks returns the Networks field value if set, zero value otherwise. func (o *GetClientConfig200ResponseDenylistInner) GetNetworks() GetClientConfig200ResponseDenylistInnerNetworks { if o == nil || IsNil(o.Networks) { var ret GetClientConfig200ResponseDenylistInnerNetworks return ret } return *o.Networks } // GetNetworksOk returns a tuple with the Networks field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *GetClientConfig200ResponseDenylistInner) GetNetworksOk() (*GetClientConfig200ResponseDenylistInnerNetworks, bool) { if o == nil || IsNil(o.Networks) { return nil, false } return o.Networks, true } // HasNetworks returns a boolean if a field has been set. func (o *GetClientConfig200ResponseDenylistInner) HasNetworks() bool { if o != nil && !IsNil(o.Networks) { return true } return false } // SetNetworks gets a reference to the given GetClientConfig200ResponseDenylistInnerNetworks and assigns it to the Networks field. func (o *GetClientConfig200ResponseDenylistInner) SetNetworks(v GetClientConfig200ResponseDenylistInnerNetworks) { o.Networks = &v } // GetVisible returns the Visible field value func (o *GetClientConfig200ResponseDenylistInner) GetVisible() bool { if o == nil { var ret bool return ret } return o.Visible } // GetVisibleOk returns a tuple with the Visible field value // and a boolean to check if the value has been set. func (o *GetClientConfig200ResponseDenylistInner) GetVisibleOk() (*bool, bool) { if o == nil { return nil, false } return &o.Visible, true } // SetVisible sets field value func (o *GetClientConfig200ResponseDenylistInner) SetVisible(v bool) { o.Visible = v } func (o GetClientConfig200ResponseDenylistInner) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o GetClientConfig200ResponseDenylistInner) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !IsNil(o.AndroidPackages) { toSerialize["android-packages"] = o.AndroidPackages } toSerialize["name"] = o.Name if !IsNil(o.Networks) { toSerialize["networks"] = o.Networks } toSerialize["visible"] = o.Visible for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *GetClientConfig200ResponseDenylistInner) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "name", "visible", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varGetClientConfig200ResponseDenylistInner := _GetClientConfig200ResponseDenylistInner{} err = json.Unmarshal(data, &varGetClientConfig200ResponseDenylistInner) if err != nil { return err } *o = GetClientConfig200ResponseDenylistInner(varGetClientConfig200ResponseDenylistInner) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "android-packages") delete(additionalProperties, "name") delete(additionalProperties, "networks") delete(additionalProperties, "visible") o.AdditionalProperties = additionalProperties } return err } type NullableGetClientConfig200ResponseDenylistInner struct { value *GetClientConfig200ResponseDenylistInner isSet bool } func (v NullableGetClientConfig200ResponseDenylistInner) Get() *GetClientConfig200ResponseDenylistInner { return v.value } func (v *NullableGetClientConfig200ResponseDenylistInner) Set(val *GetClientConfig200ResponseDenylistInner) { v.value = val v.isSet = true } func (v NullableGetClientConfig200ResponseDenylistInner) IsSet() bool { return v.isSet } func (v *NullableGetClientConfig200ResponseDenylistInner) Unset() { v.value = nil v.isSet = false } func NewNullableGetClientConfig200ResponseDenylistInner(val *GetClientConfig200ResponseDenylistInner) *NullableGetClientConfig200ResponseDenylistInner { return &NullableGetClientConfig200ResponseDenylistInner{value: val, isSet: true} } func (v NullableGetClientConfig200ResponseDenylistInner) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableGetClientConfig200ResponseDenylistInner) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_get_client_config_200_response_denylist_inner_networks.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the GetClientConfig200ResponseDenylistInnerNetworks type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetClientConfig200ResponseDenylistInnerNetworks{} // GetClientConfig200ResponseDenylistInnerNetworks struct for GetClientConfig200ResponseDenylistInnerNetworks type GetClientConfig200ResponseDenylistInnerNetworks struct { V4 []IPv4Network `json:"v4"` V6 []IPv6Network `json:"v6"` AdditionalProperties map[string]interface{} } type _GetClientConfig200ResponseDenylistInnerNetworks GetClientConfig200ResponseDenylistInnerNetworks // NewGetClientConfig200ResponseDenylistInnerNetworks instantiates a new GetClientConfig200ResponseDenylistInnerNetworks object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewGetClientConfig200ResponseDenylistInnerNetworks(v4 []IPv4Network, v6 []IPv6Network) *GetClientConfig200ResponseDenylistInnerNetworks { this := GetClientConfig200ResponseDenylistInnerNetworks{} this.V4 = v4 this.V6 = v6 return &this } // NewGetClientConfig200ResponseDenylistInnerNetworksWithDefaults instantiates a new GetClientConfig200ResponseDenylistInnerNetworks object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewGetClientConfig200ResponseDenylistInnerNetworksWithDefaults() *GetClientConfig200ResponseDenylistInnerNetworks { this := GetClientConfig200ResponseDenylistInnerNetworks{} return &this } // GetV4 returns the V4 field value func (o *GetClientConfig200ResponseDenylistInnerNetworks) GetV4() []IPv4Network { if o == nil { var ret []IPv4Network return ret } return o.V4 } // GetV4Ok returns a tuple with the V4 field value // and a boolean to check if the value has been set. func (o *GetClientConfig200ResponseDenylistInnerNetworks) GetV4Ok() ([]IPv4Network, bool) { if o == nil { return nil, false } return o.V4, true } // SetV4 sets field value func (o *GetClientConfig200ResponseDenylistInnerNetworks) SetV4(v []IPv4Network) { o.V4 = v } // GetV6 returns the V6 field value func (o *GetClientConfig200ResponseDenylistInnerNetworks) GetV6() []IPv6Network { if o == nil { var ret []IPv6Network return ret } return o.V6 } // GetV6Ok returns a tuple with the V6 field value // and a boolean to check if the value has been set. func (o *GetClientConfig200ResponseDenylistInnerNetworks) GetV6Ok() ([]IPv6Network, bool) { if o == nil { return nil, false } return o.V6, true } // SetV6 sets field value func (o *GetClientConfig200ResponseDenylistInnerNetworks) SetV6(v []IPv6Network) { o.V6 = v } func (o GetClientConfig200ResponseDenylistInnerNetworks) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o GetClientConfig200ResponseDenylistInnerNetworks) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["v4"] = o.V4 toSerialize["v6"] = o.V6 for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *GetClientConfig200ResponseDenylistInnerNetworks) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "v4", "v6", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varGetClientConfig200ResponseDenylistInnerNetworks := _GetClientConfig200ResponseDenylistInnerNetworks{} err = json.Unmarshal(data, &varGetClientConfig200ResponseDenylistInnerNetworks) if err != nil { return err } *o = GetClientConfig200ResponseDenylistInnerNetworks(varGetClientConfig200ResponseDenylistInnerNetworks) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "v4") delete(additionalProperties, "v6") o.AdditionalProperties = additionalProperties } return err } type NullableGetClientConfig200ResponseDenylistInnerNetworks struct { value *GetClientConfig200ResponseDenylistInnerNetworks isSet bool } func (v NullableGetClientConfig200ResponseDenylistInnerNetworks) Get() *GetClientConfig200ResponseDenylistInnerNetworks { return v.value } func (v *NullableGetClientConfig200ResponseDenylistInnerNetworks) Set(val *GetClientConfig200ResponseDenylistInnerNetworks) { v.value = val v.isSet = true } func (v NullableGetClientConfig200ResponseDenylistInnerNetworks) IsSet() bool { return v.isSet } func (v *NullableGetClientConfig200ResponseDenylistInnerNetworks) Unset() { v.value = nil v.isSet = false } func NewNullableGetClientConfig200ResponseDenylistInnerNetworks(val *GetClientConfig200ResponseDenylistInnerNetworks) *NullableGetClientConfig200ResponseDenylistInnerNetworks { return &NullableGetClientConfig200ResponseDenylistInnerNetworks{value: val, isSet: true} } func (v NullableGetClientConfig200ResponseDenylistInnerNetworks) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableGetClientConfig200ResponseDenylistInnerNetworks) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_get_source_device_200_response.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the GetSourceDevice200Response type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetSourceDevice200Response{} // GetSourceDevice200Response struct for GetSourceDevice200Response type GetSourceDevice200Response struct { Created string `json:"created"` Enabled bool `json:"enabled"` FcmToken string `json:"fcm_token"` Id string `json:"id"` InstallId string `json:"install_id"` Key string `json:"key"` Locale string `json:"locale"` Model string `json:"model"` Name string `json:"name"` Place float32 `json:"place"` Tos string `json:"tos"` Type string `json:"type"` Updated string `json:"updated"` WaitlistEnabled bool `json:"waitlist_enabled"` WarpEnabled bool `json:"warp_enabled"` Account Account `json:"account"` Config Config `json:"config"` AdditionalProperties map[string]interface{} } type _GetSourceDevice200Response GetSourceDevice200Response // NewGetSourceDevice200Response instantiates a new GetSourceDevice200Response object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewGetSourceDevice200Response(created string, enabled bool, fcmToken string, id string, installId string, key string, locale string, model string, name string, place float32, tos string, type_ string, updated string, waitlistEnabled bool, warpEnabled bool, account Account, config Config) *GetSourceDevice200Response { this := GetSourceDevice200Response{} this.Created = created this.Enabled = enabled this.FcmToken = fcmToken this.Id = id this.InstallId = installId this.Key = key this.Locale = locale this.Model = model this.Name = name this.Place = place this.Tos = tos this.Type = type_ this.Updated = updated this.WaitlistEnabled = waitlistEnabled this.WarpEnabled = warpEnabled this.Account = account this.Config = config return &this } // NewGetSourceDevice200ResponseWithDefaults instantiates a new GetSourceDevice200Response object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewGetSourceDevice200ResponseWithDefaults() *GetSourceDevice200Response { this := GetSourceDevice200Response{} return &this } // GetCreated returns the Created field value func (o *GetSourceDevice200Response) GetCreated() string { if o == nil { var ret string return ret } return o.Created } // GetCreatedOk returns a tuple with the Created field value // and a boolean to check if the value has been set. func (o *GetSourceDevice200Response) GetCreatedOk() (*string, bool) { if o == nil { return nil, false } return &o.Created, true } // SetCreated sets field value func (o *GetSourceDevice200Response) SetCreated(v string) { o.Created = v } // GetEnabled returns the Enabled field value func (o *GetSourceDevice200Response) GetEnabled() bool { if o == nil { var ret bool return ret } return o.Enabled } // GetEnabledOk returns a tuple with the Enabled field value // and a boolean to check if the value has been set. func (o *GetSourceDevice200Response) GetEnabledOk() (*bool, bool) { if o == nil { return nil, false } return &o.Enabled, true } // SetEnabled sets field value func (o *GetSourceDevice200Response) SetEnabled(v bool) { o.Enabled = v } // GetFcmToken returns the FcmToken field value func (o *GetSourceDevice200Response) GetFcmToken() string { if o == nil { var ret string return ret } return o.FcmToken } // GetFcmTokenOk returns a tuple with the FcmToken field value // and a boolean to check if the value has been set. func (o *GetSourceDevice200Response) GetFcmTokenOk() (*string, bool) { if o == nil { return nil, false } return &o.FcmToken, true } // SetFcmToken sets field value func (o *GetSourceDevice200Response) SetFcmToken(v string) { o.FcmToken = v } // GetId returns the Id field value func (o *GetSourceDevice200Response) GetId() string { if o == nil { var ret string return ret } return o.Id } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *GetSourceDevice200Response) GetIdOk() (*string, bool) { if o == nil { return nil, false } return &o.Id, true } // SetId sets field value func (o *GetSourceDevice200Response) SetId(v string) { o.Id = v } // GetInstallId returns the InstallId field value func (o *GetSourceDevice200Response) GetInstallId() string { if o == nil { var ret string return ret } return o.InstallId } // GetInstallIdOk returns a tuple with the InstallId field value // and a boolean to check if the value has been set. func (o *GetSourceDevice200Response) GetInstallIdOk() (*string, bool) { if o == nil { return nil, false } return &o.InstallId, true } // SetInstallId sets field value func (o *GetSourceDevice200Response) SetInstallId(v string) { o.InstallId = v } // GetKey returns the Key field value func (o *GetSourceDevice200Response) GetKey() string { if o == nil { var ret string return ret } return o.Key } // GetKeyOk returns a tuple with the Key field value // and a boolean to check if the value has been set. func (o *GetSourceDevice200Response) GetKeyOk() (*string, bool) { if o == nil { return nil, false } return &o.Key, true } // SetKey sets field value func (o *GetSourceDevice200Response) SetKey(v string) { o.Key = v } // GetLocale returns the Locale field value func (o *GetSourceDevice200Response) GetLocale() string { if o == nil { var ret string return ret } return o.Locale } // GetLocaleOk returns a tuple with the Locale field value // and a boolean to check if the value has been set. func (o *GetSourceDevice200Response) GetLocaleOk() (*string, bool) { if o == nil { return nil, false } return &o.Locale, true } // SetLocale sets field value func (o *GetSourceDevice200Response) SetLocale(v string) { o.Locale = v } // GetModel returns the Model field value func (o *GetSourceDevice200Response) GetModel() string { if o == nil { var ret string return ret } return o.Model } // GetModelOk returns a tuple with the Model field value // and a boolean to check if the value has been set. func (o *GetSourceDevice200Response) GetModelOk() (*string, bool) { if o == nil { return nil, false } return &o.Model, true } // SetModel sets field value func (o *GetSourceDevice200Response) SetModel(v string) { o.Model = v } // GetName returns the Name field value func (o *GetSourceDevice200Response) GetName() string { if o == nil { var ret string return ret } return o.Name } // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *GetSourceDevice200Response) GetNameOk() (*string, bool) { if o == nil { return nil, false } return &o.Name, true } // SetName sets field value func (o *GetSourceDevice200Response) SetName(v string) { o.Name = v } // GetPlace returns the Place field value func (o *GetSourceDevice200Response) GetPlace() float32 { if o == nil { var ret float32 return ret } return o.Place } // GetPlaceOk returns a tuple with the Place field value // and a boolean to check if the value has been set. func (o *GetSourceDevice200Response) GetPlaceOk() (*float32, bool) { if o == nil { return nil, false } return &o.Place, true } // SetPlace sets field value func (o *GetSourceDevice200Response) SetPlace(v float32) { o.Place = v } // GetTos returns the Tos field value func (o *GetSourceDevice200Response) GetTos() string { if o == nil { var ret string return ret } return o.Tos } // GetTosOk returns a tuple with the Tos field value // and a boolean to check if the value has been set. func (o *GetSourceDevice200Response) GetTosOk() (*string, bool) { if o == nil { return nil, false } return &o.Tos, true } // SetTos sets field value func (o *GetSourceDevice200Response) SetTos(v string) { o.Tos = v } // GetType returns the Type field value func (o *GetSourceDevice200Response) GetType() string { if o == nil { var ret string return ret } return o.Type } // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *GetSourceDevice200Response) GetTypeOk() (*string, bool) { if o == nil { return nil, false } return &o.Type, true } // SetType sets field value func (o *GetSourceDevice200Response) SetType(v string) { o.Type = v } // GetUpdated returns the Updated field value func (o *GetSourceDevice200Response) GetUpdated() string { if o == nil { var ret string return ret } return o.Updated } // GetUpdatedOk returns a tuple with the Updated field value // and a boolean to check if the value has been set. func (o *GetSourceDevice200Response) GetUpdatedOk() (*string, bool) { if o == nil { return nil, false } return &o.Updated, true } // SetUpdated sets field value func (o *GetSourceDevice200Response) SetUpdated(v string) { o.Updated = v } // GetWaitlistEnabled returns the WaitlistEnabled field value func (o *GetSourceDevice200Response) GetWaitlistEnabled() bool { if o == nil { var ret bool return ret } return o.WaitlistEnabled } // GetWaitlistEnabledOk returns a tuple with the WaitlistEnabled field value // and a boolean to check if the value has been set. func (o *GetSourceDevice200Response) GetWaitlistEnabledOk() (*bool, bool) { if o == nil { return nil, false } return &o.WaitlistEnabled, true } // SetWaitlistEnabled sets field value func (o *GetSourceDevice200Response) SetWaitlistEnabled(v bool) { o.WaitlistEnabled = v } // GetWarpEnabled returns the WarpEnabled field value func (o *GetSourceDevice200Response) GetWarpEnabled() bool { if o == nil { var ret bool return ret } return o.WarpEnabled } // GetWarpEnabledOk returns a tuple with the WarpEnabled field value // and a boolean to check if the value has been set. func (o *GetSourceDevice200Response) GetWarpEnabledOk() (*bool, bool) { if o == nil { return nil, false } return &o.WarpEnabled, true } // SetWarpEnabled sets field value func (o *GetSourceDevice200Response) SetWarpEnabled(v bool) { o.WarpEnabled = v } // GetAccount returns the Account field value func (o *GetSourceDevice200Response) GetAccount() Account { if o == nil { var ret Account return ret } return o.Account } // GetAccountOk returns a tuple with the Account field value // and a boolean to check if the value has been set. func (o *GetSourceDevice200Response) GetAccountOk() (*Account, bool) { if o == nil { return nil, false } return &o.Account, true } // SetAccount sets field value func (o *GetSourceDevice200Response) SetAccount(v Account) { o.Account = v } // GetConfig returns the Config field value func (o *GetSourceDevice200Response) GetConfig() Config { if o == nil { var ret Config return ret } return o.Config } // GetConfigOk returns a tuple with the Config field value // and a boolean to check if the value has been set. func (o *GetSourceDevice200Response) GetConfigOk() (*Config, bool) { if o == nil { return nil, false } return &o.Config, true } // SetConfig sets field value func (o *GetSourceDevice200Response) SetConfig(v Config) { o.Config = v } func (o GetSourceDevice200Response) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o GetSourceDevice200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["created"] = o.Created toSerialize["enabled"] = o.Enabled toSerialize["fcm_token"] = o.FcmToken toSerialize["id"] = o.Id toSerialize["install_id"] = o.InstallId toSerialize["key"] = o.Key toSerialize["locale"] = o.Locale toSerialize["model"] = o.Model toSerialize["name"] = o.Name toSerialize["place"] = o.Place toSerialize["tos"] = o.Tos toSerialize["type"] = o.Type toSerialize["updated"] = o.Updated toSerialize["waitlist_enabled"] = o.WaitlistEnabled toSerialize["warp_enabled"] = o.WarpEnabled toSerialize["account"] = o.Account toSerialize["config"] = o.Config for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *GetSourceDevice200Response) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "created", "enabled", "fcm_token", "id", "install_id", "key", "locale", "model", "name", "place", "tos", "type", "updated", "waitlist_enabled", "warp_enabled", "account", "config", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varGetSourceDevice200Response := _GetSourceDevice200Response{} err = json.Unmarshal(data, &varGetSourceDevice200Response) if err != nil { return err } *o = GetSourceDevice200Response(varGetSourceDevice200Response) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "created") delete(additionalProperties, "enabled") delete(additionalProperties, "fcm_token") delete(additionalProperties, "id") delete(additionalProperties, "install_id") delete(additionalProperties, "key") delete(additionalProperties, "locale") delete(additionalProperties, "model") delete(additionalProperties, "name") delete(additionalProperties, "place") delete(additionalProperties, "tos") delete(additionalProperties, "type") delete(additionalProperties, "updated") delete(additionalProperties, "waitlist_enabled") delete(additionalProperties, "warp_enabled") delete(additionalProperties, "account") delete(additionalProperties, "config") o.AdditionalProperties = additionalProperties } return err } type NullableGetSourceDevice200Response struct { value *GetSourceDevice200Response isSet bool } func (v NullableGetSourceDevice200Response) Get() *GetSourceDevice200Response { return v.value } func (v *NullableGetSourceDevice200Response) Set(val *GetSourceDevice200Response) { v.value = val v.isSet = true } func (v NullableGetSourceDevice200Response) IsSet() bool { return v.isSet } func (v *NullableGetSourceDevice200Response) Unset() { v.value = nil v.isSet = false } func NewNullableGetSourceDevice200Response(val *GetSourceDevice200Response) *NullableGetSourceDevice200Response { return &NullableGetSourceDevice200Response{value: val, isSet: true} } func (v NullableGetSourceDevice200Response) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableGetSourceDevice200Response) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_ipv4_network.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the IPv4Network type satisfies the MappedNullable interface at compile time var _ MappedNullable = &IPv4Network{} // IPv4Network struct for IPv4Network type IPv4Network struct { Address string `json:"address"` Netmask string `json:"netmask"` AdditionalProperties map[string]interface{} } type _IPv4Network IPv4Network // NewIPv4Network instantiates a new IPv4Network object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewIPv4Network(address string, netmask string) *IPv4Network { this := IPv4Network{} this.Address = address this.Netmask = netmask return &this } // NewIPv4NetworkWithDefaults instantiates a new IPv4Network object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewIPv4NetworkWithDefaults() *IPv4Network { this := IPv4Network{} return &this } // GetAddress returns the Address field value func (o *IPv4Network) GetAddress() string { if o == nil { var ret string return ret } return o.Address } // GetAddressOk returns a tuple with the Address field value // and a boolean to check if the value has been set. func (o *IPv4Network) GetAddressOk() (*string, bool) { if o == nil { return nil, false } return &o.Address, true } // SetAddress sets field value func (o *IPv4Network) SetAddress(v string) { o.Address = v } // GetNetmask returns the Netmask field value func (o *IPv4Network) GetNetmask() string { if o == nil { var ret string return ret } return o.Netmask } // GetNetmaskOk returns a tuple with the Netmask field value // and a boolean to check if the value has been set. func (o *IPv4Network) GetNetmaskOk() (*string, bool) { if o == nil { return nil, false } return &o.Netmask, true } // SetNetmask sets field value func (o *IPv4Network) SetNetmask(v string) { o.Netmask = v } func (o IPv4Network) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o IPv4Network) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["address"] = o.Address toSerialize["netmask"] = o.Netmask for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *IPv4Network) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "address", "netmask", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varIPv4Network := _IPv4Network{} err = json.Unmarshal(data, &varIPv4Network) if err != nil { return err } *o = IPv4Network(varIPv4Network) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "address") delete(additionalProperties, "netmask") o.AdditionalProperties = additionalProperties } return err } type NullableIPv4Network struct { value *IPv4Network isSet bool } func (v NullableIPv4Network) Get() *IPv4Network { return v.value } func (v *NullableIPv4Network) Set(val *IPv4Network) { v.value = val v.isSet = true } func (v NullableIPv4Network) IsSet() bool { return v.isSet } func (v *NullableIPv4Network) Unset() { v.value = nil v.isSet = false } func NewNullableIPv4Network(val *IPv4Network) *NullableIPv4Network { return &NullableIPv4Network{value: val, isSet: true} } func (v NullableIPv4Network) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableIPv4Network) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_ipv6_network.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the IPv6Network type satisfies the MappedNullable interface at compile time var _ MappedNullable = &IPv6Network{} // IPv6Network struct for IPv6Network type IPv6Network struct { Address string `json:"address"` Prefix float32 `json:"prefix"` AdditionalProperties map[string]interface{} } type _IPv6Network IPv6Network // NewIPv6Network instantiates a new IPv6Network object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewIPv6Network(address string, prefix float32) *IPv6Network { this := IPv6Network{} this.Address = address this.Prefix = prefix return &this } // NewIPv6NetworkWithDefaults instantiates a new IPv6Network object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewIPv6NetworkWithDefaults() *IPv6Network { this := IPv6Network{} return &this } // GetAddress returns the Address field value func (o *IPv6Network) GetAddress() string { if o == nil { var ret string return ret } return o.Address } // GetAddressOk returns a tuple with the Address field value // and a boolean to check if the value has been set. func (o *IPv6Network) GetAddressOk() (*string, bool) { if o == nil { return nil, false } return &o.Address, true } // SetAddress sets field value func (o *IPv6Network) SetAddress(v string) { o.Address = v } // GetPrefix returns the Prefix field value func (o *IPv6Network) GetPrefix() float32 { if o == nil { var ret float32 return ret } return o.Prefix } // GetPrefixOk returns a tuple with the Prefix field value // and a boolean to check if the value has been set. func (o *IPv6Network) GetPrefixOk() (*float32, bool) { if o == nil { return nil, false } return &o.Prefix, true } // SetPrefix sets field value func (o *IPv6Network) SetPrefix(v float32) { o.Prefix = v } func (o IPv6Network) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o IPv6Network) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["address"] = o.Address toSerialize["prefix"] = o.Prefix for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *IPv6Network) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "address", "prefix", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varIPv6Network := _IPv6Network{} err = json.Unmarshal(data, &varIPv6Network) if err != nil { return err } *o = IPv6Network(varIPv6Network) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "address") delete(additionalProperties, "prefix") o.AdditionalProperties = additionalProperties } return err } type NullableIPv6Network struct { value *IPv6Network isSet bool } func (v NullableIPv6Network) Get() *IPv6Network { return v.value } func (v *NullableIPv6Network) Set(val *IPv6Network) { v.value = val v.isSet = true } func (v NullableIPv6Network) IsSet() bool { return v.isSet } func (v *NullableIPv6Network) Unset() { v.value = nil v.isSet = false } func NewNullableIPv6Network(val *IPv6Network) *NullableIPv6Network { return &NullableIPv6Network{value: val, isSet: true} } func (v NullableIPv6Network) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableIPv6Network) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_network_address.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the NetworkAddress type satisfies the MappedNullable interface at compile time var _ MappedNullable = &NetworkAddress{} // NetworkAddress struct for NetworkAddress type NetworkAddress struct { V4 string `json:"v4"` V6 string `json:"v6"` AdditionalProperties map[string]interface{} } type _NetworkAddress NetworkAddress // NewNetworkAddress instantiates a new NetworkAddress object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewNetworkAddress(v4 string, v6 string) *NetworkAddress { this := NetworkAddress{} this.V4 = v4 this.V6 = v6 return &this } // NewNetworkAddressWithDefaults instantiates a new NetworkAddress object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewNetworkAddressWithDefaults() *NetworkAddress { this := NetworkAddress{} return &this } // GetV4 returns the V4 field value func (o *NetworkAddress) GetV4() string { if o == nil { var ret string return ret } return o.V4 } // GetV4Ok returns a tuple with the V4 field value // and a boolean to check if the value has been set. func (o *NetworkAddress) GetV4Ok() (*string, bool) { if o == nil { return nil, false } return &o.V4, true } // SetV4 sets field value func (o *NetworkAddress) SetV4(v string) { o.V4 = v } // GetV6 returns the V6 field value func (o *NetworkAddress) GetV6() string { if o == nil { var ret string return ret } return o.V6 } // GetV6Ok returns a tuple with the V6 field value // and a boolean to check if the value has been set. func (o *NetworkAddress) GetV6Ok() (*string, bool) { if o == nil { return nil, false } return &o.V6, true } // SetV6 sets field value func (o *NetworkAddress) SetV6(v string) { o.V6 = v } func (o NetworkAddress) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o NetworkAddress) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["v4"] = o.V4 toSerialize["v6"] = o.V6 for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *NetworkAddress) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "v4", "v6", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varNetworkAddress := _NetworkAddress{} err = json.Unmarshal(data, &varNetworkAddress) if err != nil { return err } *o = NetworkAddress(varNetworkAddress) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "v4") delete(additionalProperties, "v6") o.AdditionalProperties = additionalProperties } return err } type NullableNetworkAddress struct { value *NetworkAddress isSet bool } func (v NullableNetworkAddress) Get() *NetworkAddress { return v.value } func (v *NullableNetworkAddress) Set(val *NetworkAddress) { v.value = val v.isSet = true } func (v NullableNetworkAddress) IsSet() bool { return v.isSet } func (v *NullableNetworkAddress) Unset() { v.value = nil v.isSet = false } func NewNullableNetworkAddress(val *NetworkAddress) *NullableNetworkAddress { return &NullableNetworkAddress{value: val, isSet: true} } func (v NullableNetworkAddress) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableNetworkAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_peer.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the Peer type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Peer{} // Peer struct for Peer type Peer struct { Endpoint Endpoint `json:"endpoint"` PublicKey string `json:"public_key"` AdditionalProperties map[string]interface{} } type _Peer Peer // NewPeer instantiates a new Peer object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewPeer(endpoint Endpoint, publicKey string) *Peer { this := Peer{} this.Endpoint = endpoint this.PublicKey = publicKey return &this } // NewPeerWithDefaults instantiates a new Peer object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewPeerWithDefaults() *Peer { this := Peer{} return &this } // GetEndpoint returns the Endpoint field value func (o *Peer) GetEndpoint() Endpoint { if o == nil { var ret Endpoint return ret } return o.Endpoint } // GetEndpointOk returns a tuple with the Endpoint field value // and a boolean to check if the value has been set. func (o *Peer) GetEndpointOk() (*Endpoint, bool) { if o == nil { return nil, false } return &o.Endpoint, true } // SetEndpoint sets field value func (o *Peer) SetEndpoint(v Endpoint) { o.Endpoint = v } // GetPublicKey returns the PublicKey field value func (o *Peer) GetPublicKey() string { if o == nil { var ret string return ret } return o.PublicKey } // GetPublicKeyOk returns a tuple with the PublicKey field value // and a boolean to check if the value has been set. func (o *Peer) GetPublicKeyOk() (*string, bool) { if o == nil { return nil, false } return &o.PublicKey, true } // SetPublicKey sets field value func (o *Peer) SetPublicKey(v string) { o.PublicKey = v } func (o Peer) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o Peer) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["endpoint"] = o.Endpoint toSerialize["public_key"] = o.PublicKey for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *Peer) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "endpoint", "public_key", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varPeer := _Peer{} err = json.Unmarshal(data, &varPeer) if err != nil { return err } *o = Peer(varPeer) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "endpoint") delete(additionalProperties, "public_key") o.AdditionalProperties = additionalProperties } return err } type NullablePeer struct { value *Peer isSet bool } func (v NullablePeer) Get() *Peer { return v.value } func (v *NullablePeer) Set(val *Peer) { v.value = val v.isSet = true } func (v NullablePeer) IsSet() bool { return v.isSet } func (v *NullablePeer) Unset() { v.value = nil v.isSet = false } func NewNullablePeer(val *Peer) *NullablePeer { return &NullablePeer{value: val, isSet: true} } func (v NullablePeer) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullablePeer) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_register_200_response.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the Register200Response type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Register200Response{} // Register200Response struct for Register200Response type Register200Response struct { Created string `json:"created"` Enabled bool `json:"enabled"` FcmToken string `json:"fcm_token"` Id string `json:"id"` InstallId string `json:"install_id"` Key string `json:"key"` Locale string `json:"locale"` Model string `json:"model"` Name string `json:"name"` Place float32 `json:"place"` Tos string `json:"tos"` Type string `json:"type"` Updated string `json:"updated"` WaitlistEnabled bool `json:"waitlist_enabled"` WarpEnabled bool `json:"warp_enabled"` Account Account `json:"account"` Config Config `json:"config"` Token string `json:"token"` AdditionalProperties map[string]interface{} } type _Register200Response Register200Response // NewRegister200Response instantiates a new Register200Response object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewRegister200Response(created string, enabled bool, fcmToken string, id string, installId string, key string, locale string, model string, name string, place float32, tos string, type_ string, updated string, waitlistEnabled bool, warpEnabled bool, account Account, config Config, token string) *Register200Response { this := Register200Response{} this.Created = created this.Enabled = enabled this.FcmToken = fcmToken this.Id = id this.InstallId = installId this.Key = key this.Locale = locale this.Model = model this.Name = name this.Place = place this.Tos = tos this.Type = type_ this.Updated = updated this.WaitlistEnabled = waitlistEnabled this.WarpEnabled = warpEnabled this.Account = account this.Config = config this.Token = token return &this } // NewRegister200ResponseWithDefaults instantiates a new Register200Response object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewRegister200ResponseWithDefaults() *Register200Response { this := Register200Response{} return &this } // GetCreated returns the Created field value func (o *Register200Response) GetCreated() string { if o == nil { var ret string return ret } return o.Created } // GetCreatedOk returns a tuple with the Created field value // and a boolean to check if the value has been set. func (o *Register200Response) GetCreatedOk() (*string, bool) { if o == nil { return nil, false } return &o.Created, true } // SetCreated sets field value func (o *Register200Response) SetCreated(v string) { o.Created = v } // GetEnabled returns the Enabled field value func (o *Register200Response) GetEnabled() bool { if o == nil { var ret bool return ret } return o.Enabled } // GetEnabledOk returns a tuple with the Enabled field value // and a boolean to check if the value has been set. func (o *Register200Response) GetEnabledOk() (*bool, bool) { if o == nil { return nil, false } return &o.Enabled, true } // SetEnabled sets field value func (o *Register200Response) SetEnabled(v bool) { o.Enabled = v } // GetFcmToken returns the FcmToken field value func (o *Register200Response) GetFcmToken() string { if o == nil { var ret string return ret } return o.FcmToken } // GetFcmTokenOk returns a tuple with the FcmToken field value // and a boolean to check if the value has been set. func (o *Register200Response) GetFcmTokenOk() (*string, bool) { if o == nil { return nil, false } return &o.FcmToken, true } // SetFcmToken sets field value func (o *Register200Response) SetFcmToken(v string) { o.FcmToken = v } // GetId returns the Id field value func (o *Register200Response) GetId() string { if o == nil { var ret string return ret } return o.Id } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *Register200Response) GetIdOk() (*string, bool) { if o == nil { return nil, false } return &o.Id, true } // SetId sets field value func (o *Register200Response) SetId(v string) { o.Id = v } // GetInstallId returns the InstallId field value func (o *Register200Response) GetInstallId() string { if o == nil { var ret string return ret } return o.InstallId } // GetInstallIdOk returns a tuple with the InstallId field value // and a boolean to check if the value has been set. func (o *Register200Response) GetInstallIdOk() (*string, bool) { if o == nil { return nil, false } return &o.InstallId, true } // SetInstallId sets field value func (o *Register200Response) SetInstallId(v string) { o.InstallId = v } // GetKey returns the Key field value func (o *Register200Response) GetKey() string { if o == nil { var ret string return ret } return o.Key } // GetKeyOk returns a tuple with the Key field value // and a boolean to check if the value has been set. func (o *Register200Response) GetKeyOk() (*string, bool) { if o == nil { return nil, false } return &o.Key, true } // SetKey sets field value func (o *Register200Response) SetKey(v string) { o.Key = v } // GetLocale returns the Locale field value func (o *Register200Response) GetLocale() string { if o == nil { var ret string return ret } return o.Locale } // GetLocaleOk returns a tuple with the Locale field value // and a boolean to check if the value has been set. func (o *Register200Response) GetLocaleOk() (*string, bool) { if o == nil { return nil, false } return &o.Locale, true } // SetLocale sets field value func (o *Register200Response) SetLocale(v string) { o.Locale = v } // GetModel returns the Model field value func (o *Register200Response) GetModel() string { if o == nil { var ret string return ret } return o.Model } // GetModelOk returns a tuple with the Model field value // and a boolean to check if the value has been set. func (o *Register200Response) GetModelOk() (*string, bool) { if o == nil { return nil, false } return &o.Model, true } // SetModel sets field value func (o *Register200Response) SetModel(v string) { o.Model = v } // GetName returns the Name field value func (o *Register200Response) GetName() string { if o == nil { var ret string return ret } return o.Name } // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *Register200Response) GetNameOk() (*string, bool) { if o == nil { return nil, false } return &o.Name, true } // SetName sets field value func (o *Register200Response) SetName(v string) { o.Name = v } // GetPlace returns the Place field value func (o *Register200Response) GetPlace() float32 { if o == nil { var ret float32 return ret } return o.Place } // GetPlaceOk returns a tuple with the Place field value // and a boolean to check if the value has been set. func (o *Register200Response) GetPlaceOk() (*float32, bool) { if o == nil { return nil, false } return &o.Place, true } // SetPlace sets field value func (o *Register200Response) SetPlace(v float32) { o.Place = v } // GetTos returns the Tos field value func (o *Register200Response) GetTos() string { if o == nil { var ret string return ret } return o.Tos } // GetTosOk returns a tuple with the Tos field value // and a boolean to check if the value has been set. func (o *Register200Response) GetTosOk() (*string, bool) { if o == nil { return nil, false } return &o.Tos, true } // SetTos sets field value func (o *Register200Response) SetTos(v string) { o.Tos = v } // GetType returns the Type field value func (o *Register200Response) GetType() string { if o == nil { var ret string return ret } return o.Type } // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *Register200Response) GetTypeOk() (*string, bool) { if o == nil { return nil, false } return &o.Type, true } // SetType sets field value func (o *Register200Response) SetType(v string) { o.Type = v } // GetUpdated returns the Updated field value func (o *Register200Response) GetUpdated() string { if o == nil { var ret string return ret } return o.Updated } // GetUpdatedOk returns a tuple with the Updated field value // and a boolean to check if the value has been set. func (o *Register200Response) GetUpdatedOk() (*string, bool) { if o == nil { return nil, false } return &o.Updated, true } // SetUpdated sets field value func (o *Register200Response) SetUpdated(v string) { o.Updated = v } // GetWaitlistEnabled returns the WaitlistEnabled field value func (o *Register200Response) GetWaitlistEnabled() bool { if o == nil { var ret bool return ret } return o.WaitlistEnabled } // GetWaitlistEnabledOk returns a tuple with the WaitlistEnabled field value // and a boolean to check if the value has been set. func (o *Register200Response) GetWaitlistEnabledOk() (*bool, bool) { if o == nil { return nil, false } return &o.WaitlistEnabled, true } // SetWaitlistEnabled sets field value func (o *Register200Response) SetWaitlistEnabled(v bool) { o.WaitlistEnabled = v } // GetWarpEnabled returns the WarpEnabled field value func (o *Register200Response) GetWarpEnabled() bool { if o == nil { var ret bool return ret } return o.WarpEnabled } // GetWarpEnabledOk returns a tuple with the WarpEnabled field value // and a boolean to check if the value has been set. func (o *Register200Response) GetWarpEnabledOk() (*bool, bool) { if o == nil { return nil, false } return &o.WarpEnabled, true } // SetWarpEnabled sets field value func (o *Register200Response) SetWarpEnabled(v bool) { o.WarpEnabled = v } // GetAccount returns the Account field value func (o *Register200Response) GetAccount() Account { if o == nil { var ret Account return ret } return o.Account } // GetAccountOk returns a tuple with the Account field value // and a boolean to check if the value has been set. func (o *Register200Response) GetAccountOk() (*Account, bool) { if o == nil { return nil, false } return &o.Account, true } // SetAccount sets field value func (o *Register200Response) SetAccount(v Account) { o.Account = v } // GetConfig returns the Config field value func (o *Register200Response) GetConfig() Config { if o == nil { var ret Config return ret } return o.Config } // GetConfigOk returns a tuple with the Config field value // and a boolean to check if the value has been set. func (o *Register200Response) GetConfigOk() (*Config, bool) { if o == nil { return nil, false } return &o.Config, true } // SetConfig sets field value func (o *Register200Response) SetConfig(v Config) { o.Config = v } // GetToken returns the Token field value func (o *Register200Response) GetToken() string { if o == nil { var ret string return ret } return o.Token } // GetTokenOk returns a tuple with the Token field value // and a boolean to check if the value has been set. func (o *Register200Response) GetTokenOk() (*string, bool) { if o == nil { return nil, false } return &o.Token, true } // SetToken sets field value func (o *Register200Response) SetToken(v string) { o.Token = v } func (o Register200Response) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o Register200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["created"] = o.Created toSerialize["enabled"] = o.Enabled toSerialize["fcm_token"] = o.FcmToken toSerialize["id"] = o.Id toSerialize["install_id"] = o.InstallId toSerialize["key"] = o.Key toSerialize["locale"] = o.Locale toSerialize["model"] = o.Model toSerialize["name"] = o.Name toSerialize["place"] = o.Place toSerialize["tos"] = o.Tos toSerialize["type"] = o.Type toSerialize["updated"] = o.Updated toSerialize["waitlist_enabled"] = o.WaitlistEnabled toSerialize["warp_enabled"] = o.WarpEnabled toSerialize["account"] = o.Account toSerialize["config"] = o.Config toSerialize["token"] = o.Token for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *Register200Response) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "created", "enabled", "fcm_token", "id", "install_id", "key", "locale", "model", "name", "place", "tos", "type", "updated", "waitlist_enabled", "warp_enabled", "account", "config", "token", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varRegister200Response := _Register200Response{} err = json.Unmarshal(data, &varRegister200Response) if err != nil { return err } *o = Register200Response(varRegister200Response) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "created") delete(additionalProperties, "enabled") delete(additionalProperties, "fcm_token") delete(additionalProperties, "id") delete(additionalProperties, "install_id") delete(additionalProperties, "key") delete(additionalProperties, "locale") delete(additionalProperties, "model") delete(additionalProperties, "name") delete(additionalProperties, "place") delete(additionalProperties, "tos") delete(additionalProperties, "type") delete(additionalProperties, "updated") delete(additionalProperties, "waitlist_enabled") delete(additionalProperties, "warp_enabled") delete(additionalProperties, "account") delete(additionalProperties, "config") delete(additionalProperties, "token") o.AdditionalProperties = additionalProperties } return err } type NullableRegister200Response struct { value *Register200Response isSet bool } func (v NullableRegister200Response) Get() *Register200Response { return v.value } func (v *NullableRegister200Response) Set(val *Register200Response) { v.value = val v.isSet = true } func (v NullableRegister200Response) IsSet() bool { return v.isSet } func (v *NullableRegister200Response) Unset() { v.value = nil v.isSet = false } func NewNullableRegister200Response(val *Register200Response) *NullableRegister200Response { return &NullableRegister200Response{value: val, isSet: true} } func (v NullableRegister200Response) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableRegister200Response) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_register_request.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the RegisterRequest type satisfies the MappedNullable interface at compile time var _ MappedNullable = &RegisterRequest{} // RegisterRequest struct for RegisterRequest type RegisterRequest struct { FcmToken string `json:"fcm_token"` InstallId string `json:"install_id"` Key string `json:"key"` Locale string `json:"locale"` Model string `json:"model"` Tos string `json:"tos"` Type string `json:"type"` AdditionalProperties map[string]interface{} } type _RegisterRequest RegisterRequest // NewRegisterRequest instantiates a new RegisterRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewRegisterRequest(fcmToken string, installId string, key string, locale string, model string, tos string, type_ string) *RegisterRequest { this := RegisterRequest{} this.FcmToken = fcmToken this.InstallId = installId this.Key = key this.Locale = locale this.Model = model this.Tos = tos this.Type = type_ return &this } // NewRegisterRequestWithDefaults instantiates a new RegisterRequest object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewRegisterRequestWithDefaults() *RegisterRequest { this := RegisterRequest{} return &this } // GetFcmToken returns the FcmToken field value func (o *RegisterRequest) GetFcmToken() string { if o == nil { var ret string return ret } return o.FcmToken } // GetFcmTokenOk returns a tuple with the FcmToken field value // and a boolean to check if the value has been set. func (o *RegisterRequest) GetFcmTokenOk() (*string, bool) { if o == nil { return nil, false } return &o.FcmToken, true } // SetFcmToken sets field value func (o *RegisterRequest) SetFcmToken(v string) { o.FcmToken = v } // GetInstallId returns the InstallId field value func (o *RegisterRequest) GetInstallId() string { if o == nil { var ret string return ret } return o.InstallId } // GetInstallIdOk returns a tuple with the InstallId field value // and a boolean to check if the value has been set. func (o *RegisterRequest) GetInstallIdOk() (*string, bool) { if o == nil { return nil, false } return &o.InstallId, true } // SetInstallId sets field value func (o *RegisterRequest) SetInstallId(v string) { o.InstallId = v } // GetKey returns the Key field value func (o *RegisterRequest) GetKey() string { if o == nil { var ret string return ret } return o.Key } // GetKeyOk returns a tuple with the Key field value // and a boolean to check if the value has been set. func (o *RegisterRequest) GetKeyOk() (*string, bool) { if o == nil { return nil, false } return &o.Key, true } // SetKey sets field value func (o *RegisterRequest) SetKey(v string) { o.Key = v } // GetLocale returns the Locale field value func (o *RegisterRequest) GetLocale() string { if o == nil { var ret string return ret } return o.Locale } // GetLocaleOk returns a tuple with the Locale field value // and a boolean to check if the value has been set. func (o *RegisterRequest) GetLocaleOk() (*string, bool) { if o == nil { return nil, false } return &o.Locale, true } // SetLocale sets field value func (o *RegisterRequest) SetLocale(v string) { o.Locale = v } // GetModel returns the Model field value func (o *RegisterRequest) GetModel() string { if o == nil { var ret string return ret } return o.Model } // GetModelOk returns a tuple with the Model field value // and a boolean to check if the value has been set. func (o *RegisterRequest) GetModelOk() (*string, bool) { if o == nil { return nil, false } return &o.Model, true } // SetModel sets field value func (o *RegisterRequest) SetModel(v string) { o.Model = v } // GetTos returns the Tos field value func (o *RegisterRequest) GetTos() string { if o == nil { var ret string return ret } return o.Tos } // GetTosOk returns a tuple with the Tos field value // and a boolean to check if the value has been set. func (o *RegisterRequest) GetTosOk() (*string, bool) { if o == nil { return nil, false } return &o.Tos, true } // SetTos sets field value func (o *RegisterRequest) SetTos(v string) { o.Tos = v } // GetType returns the Type field value func (o *RegisterRequest) GetType() string { if o == nil { var ret string return ret } return o.Type } // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *RegisterRequest) GetTypeOk() (*string, bool) { if o == nil { return nil, false } return &o.Type, true } // SetType sets field value func (o *RegisterRequest) SetType(v string) { o.Type = v } func (o RegisterRequest) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o RegisterRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["fcm_token"] = o.FcmToken toSerialize["install_id"] = o.InstallId toSerialize["key"] = o.Key toSerialize["locale"] = o.Locale toSerialize["model"] = o.Model toSerialize["tos"] = o.Tos toSerialize["type"] = o.Type for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *RegisterRequest) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "fcm_token", "install_id", "key", "locale", "model", "tos", "type", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varRegisterRequest := _RegisterRequest{} err = json.Unmarshal(data, &varRegisterRequest) if err != nil { return err } *o = RegisterRequest(varRegisterRequest) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "fcm_token") delete(additionalProperties, "install_id") delete(additionalProperties, "key") delete(additionalProperties, "locale") delete(additionalProperties, "model") delete(additionalProperties, "tos") delete(additionalProperties, "type") o.AdditionalProperties = additionalProperties } return err } type NullableRegisterRequest struct { value *RegisterRequest isSet bool } func (v NullableRegisterRequest) Get() *RegisterRequest { return v.value } func (v *NullableRegisterRequest) Set(val *RegisterRequest) { v.value = val v.isSet = true } func (v NullableRegisterRequest) IsSet() bool { return v.isSet } func (v *NullableRegisterRequest) Unset() { v.value = nil v.isSet = false } func NewNullableRegisterRequest(val *RegisterRequest) *NullableRegisterRequest { return &NullableRegisterRequest{value: val, isSet: true} } func (v NullableRegisterRequest) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableRegisterRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_reset_account_license_200_response.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the ResetAccountLicense200Response type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ResetAccountLicense200Response{} // ResetAccountLicense200Response struct for ResetAccountLicense200Response type ResetAccountLicense200Response struct { License string `json:"license"` AdditionalProperties map[string]interface{} } type _ResetAccountLicense200Response ResetAccountLicense200Response // NewResetAccountLicense200Response instantiates a new ResetAccountLicense200Response object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewResetAccountLicense200Response(license string) *ResetAccountLicense200Response { this := ResetAccountLicense200Response{} this.License = license return &this } // NewResetAccountLicense200ResponseWithDefaults instantiates a new ResetAccountLicense200Response object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewResetAccountLicense200ResponseWithDefaults() *ResetAccountLicense200Response { this := ResetAccountLicense200Response{} return &this } // GetLicense returns the License field value func (o *ResetAccountLicense200Response) GetLicense() string { if o == nil { var ret string return ret } return o.License } // GetLicenseOk returns a tuple with the License field value // and a boolean to check if the value has been set. func (o *ResetAccountLicense200Response) GetLicenseOk() (*string, bool) { if o == nil { return nil, false } return &o.License, true } // SetLicense sets field value func (o *ResetAccountLicense200Response) SetLicense(v string) { o.License = v } func (o ResetAccountLicense200Response) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o ResetAccountLicense200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["license"] = o.License for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *ResetAccountLicense200Response) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "license", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varResetAccountLicense200Response := _ResetAccountLicense200Response{} err = json.Unmarshal(data, &varResetAccountLicense200Response) if err != nil { return err } *o = ResetAccountLicense200Response(varResetAccountLicense200Response) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "license") o.AdditionalProperties = additionalProperties } return err } type NullableResetAccountLicense200Response struct { value *ResetAccountLicense200Response isSet bool } func (v NullableResetAccountLicense200Response) Get() *ResetAccountLicense200Response { return v.value } func (v *NullableResetAccountLicense200Response) Set(val *ResetAccountLicense200Response) { v.value = val v.isSet = true } func (v NullableResetAccountLicense200Response) IsSet() bool { return v.isSet } func (v *NullableResetAccountLicense200Response) Unset() { v.value = nil v.isSet = false } func NewNullableResetAccountLicense200Response(val *ResetAccountLicense200Response) *NullableResetAccountLicense200Response { return &NullableResetAccountLicense200Response{value: val, isSet: true} } func (v NullableResetAccountLicense200Response) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableResetAccountLicense200Response) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_source_device.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the SourceDevice type satisfies the MappedNullable interface at compile time var _ MappedNullable = &SourceDevice{} // SourceDevice struct for SourceDevice type SourceDevice struct { Created string `json:"created"` Enabled bool `json:"enabled"` FcmToken string `json:"fcm_token"` Id string `json:"id"` InstallId string `json:"install_id"` Key string `json:"key"` Locale string `json:"locale"` Model string `json:"model"` Name string `json:"name"` Place float32 `json:"place"` Tos string `json:"tos"` Type string `json:"type"` Updated string `json:"updated"` WaitlistEnabled bool `json:"waitlist_enabled"` WarpEnabled bool `json:"warp_enabled"` AdditionalProperties map[string]interface{} } type _SourceDevice SourceDevice // NewSourceDevice instantiates a new SourceDevice object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewSourceDevice(created string, enabled bool, fcmToken string, id string, installId string, key string, locale string, model string, name string, place float32, tos string, type_ string, updated string, waitlistEnabled bool, warpEnabled bool) *SourceDevice { this := SourceDevice{} this.Created = created this.Enabled = enabled this.FcmToken = fcmToken this.Id = id this.InstallId = installId this.Key = key this.Locale = locale this.Model = model this.Name = name this.Place = place this.Tos = tos this.Type = type_ this.Updated = updated this.WaitlistEnabled = waitlistEnabled this.WarpEnabled = warpEnabled return &this } // NewSourceDeviceWithDefaults instantiates a new SourceDevice object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewSourceDeviceWithDefaults() *SourceDevice { this := SourceDevice{} return &this } // GetCreated returns the Created field value func (o *SourceDevice) GetCreated() string { if o == nil { var ret string return ret } return o.Created } // GetCreatedOk returns a tuple with the Created field value // and a boolean to check if the value has been set. func (o *SourceDevice) GetCreatedOk() (*string, bool) { if o == nil { return nil, false } return &o.Created, true } // SetCreated sets field value func (o *SourceDevice) SetCreated(v string) { o.Created = v } // GetEnabled returns the Enabled field value func (o *SourceDevice) GetEnabled() bool { if o == nil { var ret bool return ret } return o.Enabled } // GetEnabledOk returns a tuple with the Enabled field value // and a boolean to check if the value has been set. func (o *SourceDevice) GetEnabledOk() (*bool, bool) { if o == nil { return nil, false } return &o.Enabled, true } // SetEnabled sets field value func (o *SourceDevice) SetEnabled(v bool) { o.Enabled = v } // GetFcmToken returns the FcmToken field value func (o *SourceDevice) GetFcmToken() string { if o == nil { var ret string return ret } return o.FcmToken } // GetFcmTokenOk returns a tuple with the FcmToken field value // and a boolean to check if the value has been set. func (o *SourceDevice) GetFcmTokenOk() (*string, bool) { if o == nil { return nil, false } return &o.FcmToken, true } // SetFcmToken sets field value func (o *SourceDevice) SetFcmToken(v string) { o.FcmToken = v } // GetId returns the Id field value func (o *SourceDevice) GetId() string { if o == nil { var ret string return ret } return o.Id } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *SourceDevice) GetIdOk() (*string, bool) { if o == nil { return nil, false } return &o.Id, true } // SetId sets field value func (o *SourceDevice) SetId(v string) { o.Id = v } // GetInstallId returns the InstallId field value func (o *SourceDevice) GetInstallId() string { if o == nil { var ret string return ret } return o.InstallId } // GetInstallIdOk returns a tuple with the InstallId field value // and a boolean to check if the value has been set. func (o *SourceDevice) GetInstallIdOk() (*string, bool) { if o == nil { return nil, false } return &o.InstallId, true } // SetInstallId sets field value func (o *SourceDevice) SetInstallId(v string) { o.InstallId = v } // GetKey returns the Key field value func (o *SourceDevice) GetKey() string { if o == nil { var ret string return ret } return o.Key } // GetKeyOk returns a tuple with the Key field value // and a boolean to check if the value has been set. func (o *SourceDevice) GetKeyOk() (*string, bool) { if o == nil { return nil, false } return &o.Key, true } // SetKey sets field value func (o *SourceDevice) SetKey(v string) { o.Key = v } // GetLocale returns the Locale field value func (o *SourceDevice) GetLocale() string { if o == nil { var ret string return ret } return o.Locale } // GetLocaleOk returns a tuple with the Locale field value // and a boolean to check if the value has been set. func (o *SourceDevice) GetLocaleOk() (*string, bool) { if o == nil { return nil, false } return &o.Locale, true } // SetLocale sets field value func (o *SourceDevice) SetLocale(v string) { o.Locale = v } // GetModel returns the Model field value func (o *SourceDevice) GetModel() string { if o == nil { var ret string return ret } return o.Model } // GetModelOk returns a tuple with the Model field value // and a boolean to check if the value has been set. func (o *SourceDevice) GetModelOk() (*string, bool) { if o == nil { return nil, false } return &o.Model, true } // SetModel sets field value func (o *SourceDevice) SetModel(v string) { o.Model = v } // GetName returns the Name field value func (o *SourceDevice) GetName() string { if o == nil { var ret string return ret } return o.Name } // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *SourceDevice) GetNameOk() (*string, bool) { if o == nil { return nil, false } return &o.Name, true } // SetName sets field value func (o *SourceDevice) SetName(v string) { o.Name = v } // GetPlace returns the Place field value func (o *SourceDevice) GetPlace() float32 { if o == nil { var ret float32 return ret } return o.Place } // GetPlaceOk returns a tuple with the Place field value // and a boolean to check if the value has been set. func (o *SourceDevice) GetPlaceOk() (*float32, bool) { if o == nil { return nil, false } return &o.Place, true } // SetPlace sets field value func (o *SourceDevice) SetPlace(v float32) { o.Place = v } // GetTos returns the Tos field value func (o *SourceDevice) GetTos() string { if o == nil { var ret string return ret } return o.Tos } // GetTosOk returns a tuple with the Tos field value // and a boolean to check if the value has been set. func (o *SourceDevice) GetTosOk() (*string, bool) { if o == nil { return nil, false } return &o.Tos, true } // SetTos sets field value func (o *SourceDevice) SetTos(v string) { o.Tos = v } // GetType returns the Type field value func (o *SourceDevice) GetType() string { if o == nil { var ret string return ret } return o.Type } // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *SourceDevice) GetTypeOk() (*string, bool) { if o == nil { return nil, false } return &o.Type, true } // SetType sets field value func (o *SourceDevice) SetType(v string) { o.Type = v } // GetUpdated returns the Updated field value func (o *SourceDevice) GetUpdated() string { if o == nil { var ret string return ret } return o.Updated } // GetUpdatedOk returns a tuple with the Updated field value // and a boolean to check if the value has been set. func (o *SourceDevice) GetUpdatedOk() (*string, bool) { if o == nil { return nil, false } return &o.Updated, true } // SetUpdated sets field value func (o *SourceDevice) SetUpdated(v string) { o.Updated = v } // GetWaitlistEnabled returns the WaitlistEnabled field value func (o *SourceDevice) GetWaitlistEnabled() bool { if o == nil { var ret bool return ret } return o.WaitlistEnabled } // GetWaitlistEnabledOk returns a tuple with the WaitlistEnabled field value // and a boolean to check if the value has been set. func (o *SourceDevice) GetWaitlistEnabledOk() (*bool, bool) { if o == nil { return nil, false } return &o.WaitlistEnabled, true } // SetWaitlistEnabled sets field value func (o *SourceDevice) SetWaitlistEnabled(v bool) { o.WaitlistEnabled = v } // GetWarpEnabled returns the WarpEnabled field value func (o *SourceDevice) GetWarpEnabled() bool { if o == nil { var ret bool return ret } return o.WarpEnabled } // GetWarpEnabledOk returns a tuple with the WarpEnabled field value // and a boolean to check if the value has been set. func (o *SourceDevice) GetWarpEnabledOk() (*bool, bool) { if o == nil { return nil, false } return &o.WarpEnabled, true } // SetWarpEnabled sets field value func (o *SourceDevice) SetWarpEnabled(v bool) { o.WarpEnabled = v } func (o SourceDevice) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o SourceDevice) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["created"] = o.Created toSerialize["enabled"] = o.Enabled toSerialize["fcm_token"] = o.FcmToken toSerialize["id"] = o.Id toSerialize["install_id"] = o.InstallId toSerialize["key"] = o.Key toSerialize["locale"] = o.Locale toSerialize["model"] = o.Model toSerialize["name"] = o.Name toSerialize["place"] = o.Place toSerialize["tos"] = o.Tos toSerialize["type"] = o.Type toSerialize["updated"] = o.Updated toSerialize["waitlist_enabled"] = o.WaitlistEnabled toSerialize["warp_enabled"] = o.WarpEnabled for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *SourceDevice) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "created", "enabled", "fcm_token", "id", "install_id", "key", "locale", "model", "name", "place", "tos", "type", "updated", "waitlist_enabled", "warp_enabled", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varSourceDevice := _SourceDevice{} err = json.Unmarshal(data, &varSourceDevice) if err != nil { return err } *o = SourceDevice(varSourceDevice) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "created") delete(additionalProperties, "enabled") delete(additionalProperties, "fcm_token") delete(additionalProperties, "id") delete(additionalProperties, "install_id") delete(additionalProperties, "key") delete(additionalProperties, "locale") delete(additionalProperties, "model") delete(additionalProperties, "name") delete(additionalProperties, "place") delete(additionalProperties, "tos") delete(additionalProperties, "type") delete(additionalProperties, "updated") delete(additionalProperties, "waitlist_enabled") delete(additionalProperties, "warp_enabled") o.AdditionalProperties = additionalProperties } return err } type NullableSourceDevice struct { value *SourceDevice isSet bool } func (v NullableSourceDevice) Get() *SourceDevice { return v.value } func (v *NullableSourceDevice) Set(val *SourceDevice) { v.value = val v.isSet = true } func (v NullableSourceDevice) IsSet() bool { return v.isSet } func (v *NullableSourceDevice) Unset() { v.value = nil v.isSet = false } func NewNullableSourceDevice(val *SourceDevice) *NullableSourceDevice { return &NullableSourceDevice{value: val, isSet: true} } func (v NullableSourceDevice) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableSourceDevice) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_update_account_200_response.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the UpdateAccount200Response type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateAccount200Response{} // UpdateAccount200Response struct for UpdateAccount200Response type UpdateAccount200Response struct { Created string `json:"created"` Id string `json:"id"` PremiumData float32 `json:"premium_data"` Quota float32 `json:"quota"` ReferralCount float32 `json:"referral_count"` ReferralRenewalCountdown float32 `json:"referral_renewal_countdown"` Role string `json:"role"` Updated string `json:"updated"` WarpPlus bool `json:"warp_plus"` AdditionalProperties map[string]interface{} } type _UpdateAccount200Response UpdateAccount200Response // NewUpdateAccount200Response instantiates a new UpdateAccount200Response object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewUpdateAccount200Response(created string, id string, premiumData float32, quota float32, referralCount float32, referralRenewalCountdown float32, role string, updated string, warpPlus bool) *UpdateAccount200Response { this := UpdateAccount200Response{} this.Created = created this.Id = id this.PremiumData = premiumData this.Quota = quota this.ReferralCount = referralCount this.ReferralRenewalCountdown = referralRenewalCountdown this.Role = role this.Updated = updated this.WarpPlus = warpPlus return &this } // NewUpdateAccount200ResponseWithDefaults instantiates a new UpdateAccount200Response object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewUpdateAccount200ResponseWithDefaults() *UpdateAccount200Response { this := UpdateAccount200Response{} return &this } // GetCreated returns the Created field value func (o *UpdateAccount200Response) GetCreated() string { if o == nil { var ret string return ret } return o.Created } // GetCreatedOk returns a tuple with the Created field value // and a boolean to check if the value has been set. func (o *UpdateAccount200Response) GetCreatedOk() (*string, bool) { if o == nil { return nil, false } return &o.Created, true } // SetCreated sets field value func (o *UpdateAccount200Response) SetCreated(v string) { o.Created = v } // GetId returns the Id field value func (o *UpdateAccount200Response) GetId() string { if o == nil { var ret string return ret } return o.Id } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *UpdateAccount200Response) GetIdOk() (*string, bool) { if o == nil { return nil, false } return &o.Id, true } // SetId sets field value func (o *UpdateAccount200Response) SetId(v string) { o.Id = v } // GetPremiumData returns the PremiumData field value func (o *UpdateAccount200Response) GetPremiumData() float32 { if o == nil { var ret float32 return ret } return o.PremiumData } // GetPremiumDataOk returns a tuple with the PremiumData field value // and a boolean to check if the value has been set. func (o *UpdateAccount200Response) GetPremiumDataOk() (*float32, bool) { if o == nil { return nil, false } return &o.PremiumData, true } // SetPremiumData sets field value func (o *UpdateAccount200Response) SetPremiumData(v float32) { o.PremiumData = v } // GetQuota returns the Quota field value func (o *UpdateAccount200Response) GetQuota() float32 { if o == nil { var ret float32 return ret } return o.Quota } // GetQuotaOk returns a tuple with the Quota field value // and a boolean to check if the value has been set. func (o *UpdateAccount200Response) GetQuotaOk() (*float32, bool) { if o == nil { return nil, false } return &o.Quota, true } // SetQuota sets field value func (o *UpdateAccount200Response) SetQuota(v float32) { o.Quota = v } // GetReferralCount returns the ReferralCount field value func (o *UpdateAccount200Response) GetReferralCount() float32 { if o == nil { var ret float32 return ret } return o.ReferralCount } // GetReferralCountOk returns a tuple with the ReferralCount field value // and a boolean to check if the value has been set. func (o *UpdateAccount200Response) GetReferralCountOk() (*float32, bool) { if o == nil { return nil, false } return &o.ReferralCount, true } // SetReferralCount sets field value func (o *UpdateAccount200Response) SetReferralCount(v float32) { o.ReferralCount = v } // GetReferralRenewalCountdown returns the ReferralRenewalCountdown field value func (o *UpdateAccount200Response) GetReferralRenewalCountdown() float32 { if o == nil { var ret float32 return ret } return o.ReferralRenewalCountdown } // GetReferralRenewalCountdownOk returns a tuple with the ReferralRenewalCountdown field value // and a boolean to check if the value has been set. func (o *UpdateAccount200Response) GetReferralRenewalCountdownOk() (*float32, bool) { if o == nil { return nil, false } return &o.ReferralRenewalCountdown, true } // SetReferralRenewalCountdown sets field value func (o *UpdateAccount200Response) SetReferralRenewalCountdown(v float32) { o.ReferralRenewalCountdown = v } // GetRole returns the Role field value func (o *UpdateAccount200Response) GetRole() string { if o == nil { var ret string return ret } return o.Role } // GetRoleOk returns a tuple with the Role field value // and a boolean to check if the value has been set. func (o *UpdateAccount200Response) GetRoleOk() (*string, bool) { if o == nil { return nil, false } return &o.Role, true } // SetRole sets field value func (o *UpdateAccount200Response) SetRole(v string) { o.Role = v } // GetUpdated returns the Updated field value func (o *UpdateAccount200Response) GetUpdated() string { if o == nil { var ret string return ret } return o.Updated } // GetUpdatedOk returns a tuple with the Updated field value // and a boolean to check if the value has been set. func (o *UpdateAccount200Response) GetUpdatedOk() (*string, bool) { if o == nil { return nil, false } return &o.Updated, true } // SetUpdated sets field value func (o *UpdateAccount200Response) SetUpdated(v string) { o.Updated = v } // GetWarpPlus returns the WarpPlus field value func (o *UpdateAccount200Response) GetWarpPlus() bool { if o == nil { var ret bool return ret } return o.WarpPlus } // GetWarpPlusOk returns a tuple with the WarpPlus field value // and a boolean to check if the value has been set. func (o *UpdateAccount200Response) GetWarpPlusOk() (*bool, bool) { if o == nil { return nil, false } return &o.WarpPlus, true } // SetWarpPlus sets field value func (o *UpdateAccount200Response) SetWarpPlus(v bool) { o.WarpPlus = v } func (o UpdateAccount200Response) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o UpdateAccount200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["created"] = o.Created toSerialize["id"] = o.Id toSerialize["premium_data"] = o.PremiumData toSerialize["quota"] = o.Quota toSerialize["referral_count"] = o.ReferralCount toSerialize["referral_renewal_countdown"] = o.ReferralRenewalCountdown toSerialize["role"] = o.Role toSerialize["updated"] = o.Updated toSerialize["warp_plus"] = o.WarpPlus for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *UpdateAccount200Response) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "created", "id", "premium_data", "quota", "referral_count", "referral_renewal_countdown", "role", "updated", "warp_plus", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varUpdateAccount200Response := _UpdateAccount200Response{} err = json.Unmarshal(data, &varUpdateAccount200Response) if err != nil { return err } *o = UpdateAccount200Response(varUpdateAccount200Response) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "created") delete(additionalProperties, "id") delete(additionalProperties, "premium_data") delete(additionalProperties, "quota") delete(additionalProperties, "referral_count") delete(additionalProperties, "referral_renewal_countdown") delete(additionalProperties, "role") delete(additionalProperties, "updated") delete(additionalProperties, "warp_plus") o.AdditionalProperties = additionalProperties } return err } type NullableUpdateAccount200Response struct { value *UpdateAccount200Response isSet bool } func (v NullableUpdateAccount200Response) Get() *UpdateAccount200Response { return v.value } func (v *NullableUpdateAccount200Response) Set(val *UpdateAccount200Response) { v.value = val v.isSet = true } func (v NullableUpdateAccount200Response) IsSet() bool { return v.isSet } func (v *NullableUpdateAccount200Response) Unset() { v.value = nil v.isSet = false } func NewNullableUpdateAccount200Response(val *UpdateAccount200Response) *NullableUpdateAccount200Response { return &NullableUpdateAccount200Response{value: val, isSet: true} } func (v NullableUpdateAccount200Response) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableUpdateAccount200Response) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_update_account_request.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the UpdateAccountRequest type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateAccountRequest{} // UpdateAccountRequest struct for UpdateAccountRequest type UpdateAccountRequest struct { License string `json:"license"` AdditionalProperties map[string]interface{} } type _UpdateAccountRequest UpdateAccountRequest // NewUpdateAccountRequest instantiates a new UpdateAccountRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewUpdateAccountRequest(license string) *UpdateAccountRequest { this := UpdateAccountRequest{} this.License = license return &this } // NewUpdateAccountRequestWithDefaults instantiates a new UpdateAccountRequest object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewUpdateAccountRequestWithDefaults() *UpdateAccountRequest { this := UpdateAccountRequest{} return &this } // GetLicense returns the License field value func (o *UpdateAccountRequest) GetLicense() string { if o == nil { var ret string return ret } return o.License } // GetLicenseOk returns a tuple with the License field value // and a boolean to check if the value has been set. func (o *UpdateAccountRequest) GetLicenseOk() (*string, bool) { if o == nil { return nil, false } return &o.License, true } // SetLicense sets field value func (o *UpdateAccountRequest) SetLicense(v string) { o.License = v } func (o UpdateAccountRequest) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o UpdateAccountRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["license"] = o.License for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *UpdateAccountRequest) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "license", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varUpdateAccountRequest := _UpdateAccountRequest{} err = json.Unmarshal(data, &varUpdateAccountRequest) if err != nil { return err } *o = UpdateAccountRequest(varUpdateAccountRequest) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "license") o.AdditionalProperties = additionalProperties } return err } type NullableUpdateAccountRequest struct { value *UpdateAccountRequest isSet bool } func (v NullableUpdateAccountRequest) Get() *UpdateAccountRequest { return v.value } func (v *NullableUpdateAccountRequest) Set(val *UpdateAccountRequest) { v.value = val v.isSet = true } func (v NullableUpdateAccountRequest) IsSet() bool { return v.isSet } func (v *NullableUpdateAccountRequest) Unset() { v.value = nil v.isSet = false } func NewNullableUpdateAccountRequest(val *UpdateAccountRequest) *NullableUpdateAccountRequest { return &NullableUpdateAccountRequest{value: val, isSet: true} } func (v NullableUpdateAccountRequest) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableUpdateAccountRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_update_bound_device_request.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" ) // checks if the UpdateBoundDeviceRequest type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateBoundDeviceRequest{} // UpdateBoundDeviceRequest struct for UpdateBoundDeviceRequest type UpdateBoundDeviceRequest struct { Active *bool `json:"active,omitempty"` Name *string `json:"name,omitempty"` AdditionalProperties map[string]interface{} } type _UpdateBoundDeviceRequest UpdateBoundDeviceRequest // NewUpdateBoundDeviceRequest instantiates a new UpdateBoundDeviceRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewUpdateBoundDeviceRequest() *UpdateBoundDeviceRequest { this := UpdateBoundDeviceRequest{} return &this } // NewUpdateBoundDeviceRequestWithDefaults instantiates a new UpdateBoundDeviceRequest object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewUpdateBoundDeviceRequestWithDefaults() *UpdateBoundDeviceRequest { this := UpdateBoundDeviceRequest{} return &this } // GetActive returns the Active field value if set, zero value otherwise. func (o *UpdateBoundDeviceRequest) GetActive() bool { if o == nil || IsNil(o.Active) { var ret bool return ret } return *o.Active } // GetActiveOk returns a tuple with the Active field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UpdateBoundDeviceRequest) GetActiveOk() (*bool, bool) { if o == nil || IsNil(o.Active) { return nil, false } return o.Active, true } // HasActive returns a boolean if a field has been set. func (o *UpdateBoundDeviceRequest) HasActive() bool { if o != nil && !IsNil(o.Active) { return true } return false } // SetActive gets a reference to the given bool and assigns it to the Active field. func (o *UpdateBoundDeviceRequest) SetActive(v bool) { o.Active = &v } // GetName returns the Name field value if set, zero value otherwise. func (o *UpdateBoundDeviceRequest) GetName() string { if o == nil || IsNil(o.Name) { var ret string return ret } return *o.Name } // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UpdateBoundDeviceRequest) GetNameOk() (*string, bool) { if o == nil || IsNil(o.Name) { return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *UpdateBoundDeviceRequest) HasName() bool { if o != nil && !IsNil(o.Name) { return true } return false } // SetName gets a reference to the given string and assigns it to the Name field. func (o *UpdateBoundDeviceRequest) SetName(v string) { o.Name = &v } func (o UpdateBoundDeviceRequest) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o UpdateBoundDeviceRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !IsNil(o.Active) { toSerialize["active"] = o.Active } if !IsNil(o.Name) { toSerialize["name"] = o.Name } for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *UpdateBoundDeviceRequest) UnmarshalJSON(data []byte) (err error) { varUpdateBoundDeviceRequest := _UpdateBoundDeviceRequest{} err = json.Unmarshal(data, &varUpdateBoundDeviceRequest) if err != nil { return err } *o = UpdateBoundDeviceRequest(varUpdateBoundDeviceRequest) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "active") delete(additionalProperties, "name") o.AdditionalProperties = additionalProperties } return err } type NullableUpdateBoundDeviceRequest struct { value *UpdateBoundDeviceRequest isSet bool } func (v NullableUpdateBoundDeviceRequest) Get() *UpdateBoundDeviceRequest { return v.value } func (v *NullableUpdateBoundDeviceRequest) Set(val *UpdateBoundDeviceRequest) { v.value = val v.isSet = true } func (v NullableUpdateBoundDeviceRequest) IsSet() bool { return v.isSet } func (v *NullableUpdateBoundDeviceRequest) Unset() { v.value = nil v.isSet = false } func NewNullableUpdateBoundDeviceRequest(val *UpdateBoundDeviceRequest) *NullableUpdateBoundDeviceRequest { return &NullableUpdateBoundDeviceRequest{value: val, isSet: true} } func (v NullableUpdateBoundDeviceRequest) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableUpdateBoundDeviceRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_update_source_device_200_response.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the UpdateSourceDevice200Response type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateSourceDevice200Response{} // UpdateSourceDevice200Response struct for UpdateSourceDevice200Response type UpdateSourceDevice200Response struct { Created string `json:"created"` Enabled bool `json:"enabled"` FcmToken string `json:"fcm_token"` Id string `json:"id"` InstallId string `json:"install_id"` Key string `json:"key"` Locale string `json:"locale"` Model string `json:"model"` Name string `json:"name"` Place float32 `json:"place"` Tos string `json:"tos"` Type string `json:"type"` Updated string `json:"updated"` WaitlistEnabled bool `json:"waitlist_enabled"` WarpEnabled bool `json:"warp_enabled"` Account Account `json:"account"` Config Config `json:"config"` AdditionalProperties map[string]interface{} } type _UpdateSourceDevice200Response UpdateSourceDevice200Response // NewUpdateSourceDevice200Response instantiates a new UpdateSourceDevice200Response object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewUpdateSourceDevice200Response(created string, enabled bool, fcmToken string, id string, installId string, key string, locale string, model string, name string, place float32, tos string, type_ string, updated string, waitlistEnabled bool, warpEnabled bool, account Account, config Config) *UpdateSourceDevice200Response { this := UpdateSourceDevice200Response{} this.Created = created this.Enabled = enabled this.FcmToken = fcmToken this.Id = id this.InstallId = installId this.Key = key this.Locale = locale this.Model = model this.Name = name this.Place = place this.Tos = tos this.Type = type_ this.Updated = updated this.WaitlistEnabled = waitlistEnabled this.WarpEnabled = warpEnabled this.Account = account this.Config = config return &this } // NewUpdateSourceDevice200ResponseWithDefaults instantiates a new UpdateSourceDevice200Response object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewUpdateSourceDevice200ResponseWithDefaults() *UpdateSourceDevice200Response { this := UpdateSourceDevice200Response{} return &this } // GetCreated returns the Created field value func (o *UpdateSourceDevice200Response) GetCreated() string { if o == nil { var ret string return ret } return o.Created } // GetCreatedOk returns a tuple with the Created field value // and a boolean to check if the value has been set. func (o *UpdateSourceDevice200Response) GetCreatedOk() (*string, bool) { if o == nil { return nil, false } return &o.Created, true } // SetCreated sets field value func (o *UpdateSourceDevice200Response) SetCreated(v string) { o.Created = v } // GetEnabled returns the Enabled field value func (o *UpdateSourceDevice200Response) GetEnabled() bool { if o == nil { var ret bool return ret } return o.Enabled } // GetEnabledOk returns a tuple with the Enabled field value // and a boolean to check if the value has been set. func (o *UpdateSourceDevice200Response) GetEnabledOk() (*bool, bool) { if o == nil { return nil, false } return &o.Enabled, true } // SetEnabled sets field value func (o *UpdateSourceDevice200Response) SetEnabled(v bool) { o.Enabled = v } // GetFcmToken returns the FcmToken field value func (o *UpdateSourceDevice200Response) GetFcmToken() string { if o == nil { var ret string return ret } return o.FcmToken } // GetFcmTokenOk returns a tuple with the FcmToken field value // and a boolean to check if the value has been set. func (o *UpdateSourceDevice200Response) GetFcmTokenOk() (*string, bool) { if o == nil { return nil, false } return &o.FcmToken, true } // SetFcmToken sets field value func (o *UpdateSourceDevice200Response) SetFcmToken(v string) { o.FcmToken = v } // GetId returns the Id field value func (o *UpdateSourceDevice200Response) GetId() string { if o == nil { var ret string return ret } return o.Id } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *UpdateSourceDevice200Response) GetIdOk() (*string, bool) { if o == nil { return nil, false } return &o.Id, true } // SetId sets field value func (o *UpdateSourceDevice200Response) SetId(v string) { o.Id = v } // GetInstallId returns the InstallId field value func (o *UpdateSourceDevice200Response) GetInstallId() string { if o == nil { var ret string return ret } return o.InstallId } // GetInstallIdOk returns a tuple with the InstallId field value // and a boolean to check if the value has been set. func (o *UpdateSourceDevice200Response) GetInstallIdOk() (*string, bool) { if o == nil { return nil, false } return &o.InstallId, true } // SetInstallId sets field value func (o *UpdateSourceDevice200Response) SetInstallId(v string) { o.InstallId = v } // GetKey returns the Key field value func (o *UpdateSourceDevice200Response) GetKey() string { if o == nil { var ret string return ret } return o.Key } // GetKeyOk returns a tuple with the Key field value // and a boolean to check if the value has been set. func (o *UpdateSourceDevice200Response) GetKeyOk() (*string, bool) { if o == nil { return nil, false } return &o.Key, true } // SetKey sets field value func (o *UpdateSourceDevice200Response) SetKey(v string) { o.Key = v } // GetLocale returns the Locale field value func (o *UpdateSourceDevice200Response) GetLocale() string { if o == nil { var ret string return ret } return o.Locale } // GetLocaleOk returns a tuple with the Locale field value // and a boolean to check if the value has been set. func (o *UpdateSourceDevice200Response) GetLocaleOk() (*string, bool) { if o == nil { return nil, false } return &o.Locale, true } // SetLocale sets field value func (o *UpdateSourceDevice200Response) SetLocale(v string) { o.Locale = v } // GetModel returns the Model field value func (o *UpdateSourceDevice200Response) GetModel() string { if o == nil { var ret string return ret } return o.Model } // GetModelOk returns a tuple with the Model field value // and a boolean to check if the value has been set. func (o *UpdateSourceDevice200Response) GetModelOk() (*string, bool) { if o == nil { return nil, false } return &o.Model, true } // SetModel sets field value func (o *UpdateSourceDevice200Response) SetModel(v string) { o.Model = v } // GetName returns the Name field value func (o *UpdateSourceDevice200Response) GetName() string { if o == nil { var ret string return ret } return o.Name } // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *UpdateSourceDevice200Response) GetNameOk() (*string, bool) { if o == nil { return nil, false } return &o.Name, true } // SetName sets field value func (o *UpdateSourceDevice200Response) SetName(v string) { o.Name = v } // GetPlace returns the Place field value func (o *UpdateSourceDevice200Response) GetPlace() float32 { if o == nil { var ret float32 return ret } return o.Place } // GetPlaceOk returns a tuple with the Place field value // and a boolean to check if the value has been set. func (o *UpdateSourceDevice200Response) GetPlaceOk() (*float32, bool) { if o == nil { return nil, false } return &o.Place, true } // SetPlace sets field value func (o *UpdateSourceDevice200Response) SetPlace(v float32) { o.Place = v } // GetTos returns the Tos field value func (o *UpdateSourceDevice200Response) GetTos() string { if o == nil { var ret string return ret } return o.Tos } // GetTosOk returns a tuple with the Tos field value // and a boolean to check if the value has been set. func (o *UpdateSourceDevice200Response) GetTosOk() (*string, bool) { if o == nil { return nil, false } return &o.Tos, true } // SetTos sets field value func (o *UpdateSourceDevice200Response) SetTos(v string) { o.Tos = v } // GetType returns the Type field value func (o *UpdateSourceDevice200Response) GetType() string { if o == nil { var ret string return ret } return o.Type } // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *UpdateSourceDevice200Response) GetTypeOk() (*string, bool) { if o == nil { return nil, false } return &o.Type, true } // SetType sets field value func (o *UpdateSourceDevice200Response) SetType(v string) { o.Type = v } // GetUpdated returns the Updated field value func (o *UpdateSourceDevice200Response) GetUpdated() string { if o == nil { var ret string return ret } return o.Updated } // GetUpdatedOk returns a tuple with the Updated field value // and a boolean to check if the value has been set. func (o *UpdateSourceDevice200Response) GetUpdatedOk() (*string, bool) { if o == nil { return nil, false } return &o.Updated, true } // SetUpdated sets field value func (o *UpdateSourceDevice200Response) SetUpdated(v string) { o.Updated = v } // GetWaitlistEnabled returns the WaitlistEnabled field value func (o *UpdateSourceDevice200Response) GetWaitlistEnabled() bool { if o == nil { var ret bool return ret } return o.WaitlistEnabled } // GetWaitlistEnabledOk returns a tuple with the WaitlistEnabled field value // and a boolean to check if the value has been set. func (o *UpdateSourceDevice200Response) GetWaitlistEnabledOk() (*bool, bool) { if o == nil { return nil, false } return &o.WaitlistEnabled, true } // SetWaitlistEnabled sets field value func (o *UpdateSourceDevice200Response) SetWaitlistEnabled(v bool) { o.WaitlistEnabled = v } // GetWarpEnabled returns the WarpEnabled field value func (o *UpdateSourceDevice200Response) GetWarpEnabled() bool { if o == nil { var ret bool return ret } return o.WarpEnabled } // GetWarpEnabledOk returns a tuple with the WarpEnabled field value // and a boolean to check if the value has been set. func (o *UpdateSourceDevice200Response) GetWarpEnabledOk() (*bool, bool) { if o == nil { return nil, false } return &o.WarpEnabled, true } // SetWarpEnabled sets field value func (o *UpdateSourceDevice200Response) SetWarpEnabled(v bool) { o.WarpEnabled = v } // GetAccount returns the Account field value func (o *UpdateSourceDevice200Response) GetAccount() Account { if o == nil { var ret Account return ret } return o.Account } // GetAccountOk returns a tuple with the Account field value // and a boolean to check if the value has been set. func (o *UpdateSourceDevice200Response) GetAccountOk() (*Account, bool) { if o == nil { return nil, false } return &o.Account, true } // SetAccount sets field value func (o *UpdateSourceDevice200Response) SetAccount(v Account) { o.Account = v } // GetConfig returns the Config field value func (o *UpdateSourceDevice200Response) GetConfig() Config { if o == nil { var ret Config return ret } return o.Config } // GetConfigOk returns a tuple with the Config field value // and a boolean to check if the value has been set. func (o *UpdateSourceDevice200Response) GetConfigOk() (*Config, bool) { if o == nil { return nil, false } return &o.Config, true } // SetConfig sets field value func (o *UpdateSourceDevice200Response) SetConfig(v Config) { o.Config = v } func (o UpdateSourceDevice200Response) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o UpdateSourceDevice200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["created"] = o.Created toSerialize["enabled"] = o.Enabled toSerialize["fcm_token"] = o.FcmToken toSerialize["id"] = o.Id toSerialize["install_id"] = o.InstallId toSerialize["key"] = o.Key toSerialize["locale"] = o.Locale toSerialize["model"] = o.Model toSerialize["name"] = o.Name toSerialize["place"] = o.Place toSerialize["tos"] = o.Tos toSerialize["type"] = o.Type toSerialize["updated"] = o.Updated toSerialize["waitlist_enabled"] = o.WaitlistEnabled toSerialize["warp_enabled"] = o.WarpEnabled toSerialize["account"] = o.Account toSerialize["config"] = o.Config for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *UpdateSourceDevice200Response) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "created", "enabled", "fcm_token", "id", "install_id", "key", "locale", "model", "name", "place", "tos", "type", "updated", "waitlist_enabled", "warp_enabled", "account", "config", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varUpdateSourceDevice200Response := _UpdateSourceDevice200Response{} err = json.Unmarshal(data, &varUpdateSourceDevice200Response) if err != nil { return err } *o = UpdateSourceDevice200Response(varUpdateSourceDevice200Response) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "created") delete(additionalProperties, "enabled") delete(additionalProperties, "fcm_token") delete(additionalProperties, "id") delete(additionalProperties, "install_id") delete(additionalProperties, "key") delete(additionalProperties, "locale") delete(additionalProperties, "model") delete(additionalProperties, "name") delete(additionalProperties, "place") delete(additionalProperties, "tos") delete(additionalProperties, "type") delete(additionalProperties, "updated") delete(additionalProperties, "waitlist_enabled") delete(additionalProperties, "warp_enabled") delete(additionalProperties, "account") delete(additionalProperties, "config") o.AdditionalProperties = additionalProperties } return err } type NullableUpdateSourceDevice200Response struct { value *UpdateSourceDevice200Response isSet bool } func (v NullableUpdateSourceDevice200Response) Get() *UpdateSourceDevice200Response { return v.value } func (v *NullableUpdateSourceDevice200Response) Set(val *UpdateSourceDevice200Response) { v.value = val v.isSet = true } func (v NullableUpdateSourceDevice200Response) IsSet() bool { return v.isSet } func (v *NullableUpdateSourceDevice200Response) Unset() { v.value = nil v.isSet = false } func NewNullableUpdateSourceDevice200Response(val *UpdateSourceDevice200Response) *NullableUpdateSourceDevice200Response { return &NullableUpdateSourceDevice200Response{value: val, isSet: true} } func (v NullableUpdateSourceDevice200Response) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableUpdateSourceDevice200Response) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/model_update_source_device_request.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "fmt" ) // checks if the UpdateSourceDeviceRequest type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateSourceDeviceRequest{} // UpdateSourceDeviceRequest struct for UpdateSourceDeviceRequest type UpdateSourceDeviceRequest struct { Key string `json:"key"` AdditionalProperties map[string]interface{} } type _UpdateSourceDeviceRequest UpdateSourceDeviceRequest // NewUpdateSourceDeviceRequest instantiates a new UpdateSourceDeviceRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed func NewUpdateSourceDeviceRequest(key string) *UpdateSourceDeviceRequest { this := UpdateSourceDeviceRequest{} this.Key = key return &this } // NewUpdateSourceDeviceRequestWithDefaults instantiates a new UpdateSourceDeviceRequest object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewUpdateSourceDeviceRequestWithDefaults() *UpdateSourceDeviceRequest { this := UpdateSourceDeviceRequest{} return &this } // GetKey returns the Key field value func (o *UpdateSourceDeviceRequest) GetKey() string { if o == nil { var ret string return ret } return o.Key } // GetKeyOk returns a tuple with the Key field value // and a boolean to check if the value has been set. func (o *UpdateSourceDeviceRequest) GetKeyOk() (*string, bool) { if o == nil { return nil, false } return &o.Key, true } // SetKey sets field value func (o *UpdateSourceDeviceRequest) SetKey(v string) { o.Key = v } func (o UpdateSourceDeviceRequest) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o UpdateSourceDeviceRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["key"] = o.Key for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *UpdateSourceDeviceRequest) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "key", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err; } for _, requiredProperty := range(requiredProperties) { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varUpdateSourceDeviceRequest := _UpdateSourceDeviceRequest{} err = json.Unmarshal(data, &varUpdateSourceDeviceRequest) if err != nil { return err } *o = UpdateSourceDeviceRequest(varUpdateSourceDeviceRequest) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "key") o.AdditionalProperties = additionalProperties } return err } type NullableUpdateSourceDeviceRequest struct { value *UpdateSourceDeviceRequest isSet bool } func (v NullableUpdateSourceDeviceRequest) Get() *UpdateSourceDeviceRequest { return v.value } func (v *NullableUpdateSourceDeviceRequest) Set(val *UpdateSourceDeviceRequest) { v.value = val v.isSet = true } func (v NullableUpdateSourceDeviceRequest) IsSet() bool { return v.isSet } func (v *NullableUpdateSourceDeviceRequest) Unset() { v.value = nil v.isSet = false } func NewNullableUpdateSourceDeviceRequest(val *UpdateSourceDeviceRequest) *NullableUpdateSourceDeviceRequest { return &NullableUpdateSourceDeviceRequest{value: val, isSet: true} } func (v NullableUpdateSourceDeviceRequest) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableUpdateSourceDeviceRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } ================================================ FILE: openapi/response.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "net/http" ) // APIResponse stores the API response returned by the server. type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` // Operation is the name of the OpenAPI operation. Operation string `json:"operation,omitempty"` // RequestURL is the request URL. This value is always available, even if the // embedded *http.Response is nil. RequestURL string `json:"url,omitempty"` // Method is the HTTP method used for the request. This value is always // available, even if the embedded *http.Response is nil. Method string `json:"method,omitempty"` // Payload holds the contents of the response body (which may be nil or empty). // This is provided here as the raw response.Body() reader will have already // been drained. Payload []byte `json:"-"` } // NewAPIResponse returns a new APIResponse object. func NewAPIResponse(r *http.Response) *APIResponse { response := &APIResponse{Response: r} return response } // NewAPIResponseWithError returns a new APIResponse object with the provided error message. func NewAPIResponseWithError(errorMessage string) *APIResponse { response := &APIResponse{Message: errorMessage} return response } ================================================ FILE: openapi/test/api_default_test.go ================================================ /* Cloudflare WARP API Testing DefaultAPIService */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); package openapi import ( "context" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "testing" openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func Test_openapi_DefaultAPIService(t *testing.T) { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) t.Run("Test DefaultAPIService GetAccount", func(t *testing.T) { t.Skip("skip test") // remove to run test var sourceDeviceId string var apiVersion string resp, httpRes, err := apiClient.DefaultAPI.GetAccount(context.Background(), sourceDeviceId, apiVersion).Execute() require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) }) t.Run("Test DefaultAPIService GetBoundDevices", func(t *testing.T) { t.Skip("skip test") // remove to run test var sourceDeviceId string var apiVersion string resp, httpRes, err := apiClient.DefaultAPI.GetBoundDevices(context.Background(), sourceDeviceId, apiVersion).Execute() require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) }) t.Run("Test DefaultAPIService GetClientConfig", func(t *testing.T) { t.Skip("skip test") // remove to run test var apiVersion string resp, httpRes, err := apiClient.DefaultAPI.GetClientConfig(context.Background(), apiVersion).Execute() require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) }) t.Run("Test DefaultAPIService GetSourceDevice", func(t *testing.T) { t.Skip("skip test") // remove to run test var apiVersion string var sourceDeviceId string resp, httpRes, err := apiClient.DefaultAPI.GetSourceDevice(context.Background(), apiVersion, sourceDeviceId).Execute() require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) }) t.Run("Test DefaultAPIService Register", func(t *testing.T) { t.Skip("skip test") // remove to run test var apiVersion string resp, httpRes, err := apiClient.DefaultAPI.Register(context.Background(), apiVersion).Execute() require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) }) t.Run("Test DefaultAPIService ResetAccountLicense", func(t *testing.T) { t.Skip("skip test") // remove to run test var sourceDeviceId string var apiVersion string resp, httpRes, err := apiClient.DefaultAPI.ResetAccountLicense(context.Background(), sourceDeviceId, apiVersion).Execute() require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) }) t.Run("Test DefaultAPIService UpdateAccount", func(t *testing.T) { t.Skip("skip test") // remove to run test var sourceDeviceId string var apiVersion string resp, httpRes, err := apiClient.DefaultAPI.UpdateAccount(context.Background(), sourceDeviceId, apiVersion).Execute() require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) }) t.Run("Test DefaultAPIService UpdateBoundDevice", func(t *testing.T) { t.Skip("skip test") // remove to run test var sourceDeviceId string var apiVersion string var boundDeviceId string resp, httpRes, err := apiClient.DefaultAPI.UpdateBoundDevice(context.Background(), sourceDeviceId, apiVersion, boundDeviceId).Execute() require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) }) t.Run("Test DefaultAPIService UpdateSourceDevice", func(t *testing.T) { t.Skip("skip test") // remove to run test var apiVersion string var sourceDeviceId string resp, httpRes, err := apiClient.DefaultAPI.UpdateSourceDevice(context.Background(), apiVersion, sourceDeviceId).Execute() require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) }) } ================================================ FILE: openapi/utils.go ================================================ /* Cloudflare WARP API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 536 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "bytes" "encoding/json" "fmt" "reflect" "time" ) // PtrBool is a helper routine that returns a pointer to given boolean value. func PtrBool(v bool) *bool { return &v } // PtrInt is a helper routine that returns a pointer to given integer value. func PtrInt(v int) *int { return &v } // PtrInt32 is a helper routine that returns a pointer to given integer value. func PtrInt32(v int32) *int32 { return &v } // PtrInt64 is a helper routine that returns a pointer to given integer value. func PtrInt64(v int64) *int64 { return &v } // PtrFloat32 is a helper routine that returns a pointer to given float value. func PtrFloat32(v float32) *float32 { return &v } // PtrFloat64 is a helper routine that returns a pointer to given float value. func PtrFloat64(v float64) *float64 { return &v } // PtrString is a helper routine that returns a pointer to given string value. func PtrString(v string) *string { return &v } // PtrTime is helper routine that returns a pointer to given Time value. func PtrTime(v time.Time) *time.Time { return &v } type NullableBool struct { value *bool isSet bool } func (v NullableBool) Get() *bool { return v.value } func (v *NullableBool) Set(val *bool) { v.value = val v.isSet = true } func (v NullableBool) IsSet() bool { return v.isSet } func (v *NullableBool) Unset() { v.value = nil v.isSet = false } func NewNullableBool(val *bool) *NullableBool { return &NullableBool{value: val, isSet: true} } func (v NullableBool) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableBool) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } type NullableInt struct { value *int isSet bool } func (v NullableInt) Get() *int { return v.value } func (v *NullableInt) Set(val *int) { v.value = val v.isSet = true } func (v NullableInt) IsSet() bool { return v.isSet } func (v *NullableInt) Unset() { v.value = nil v.isSet = false } func NewNullableInt(val *int) *NullableInt { return &NullableInt{value: val, isSet: true} } func (v NullableInt) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableInt) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } type NullableInt32 struct { value *int32 isSet bool } func (v NullableInt32) Get() *int32 { return v.value } func (v *NullableInt32) Set(val *int32) { v.value = val v.isSet = true } func (v NullableInt32) IsSet() bool { return v.isSet } func (v *NullableInt32) Unset() { v.value = nil v.isSet = false } func NewNullableInt32(val *int32) *NullableInt32 { return &NullableInt32{value: val, isSet: true} } func (v NullableInt32) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableInt32) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } type NullableInt64 struct { value *int64 isSet bool } func (v NullableInt64) Get() *int64 { return v.value } func (v *NullableInt64) Set(val *int64) { v.value = val v.isSet = true } func (v NullableInt64) IsSet() bool { return v.isSet } func (v *NullableInt64) Unset() { v.value = nil v.isSet = false } func NewNullableInt64(val *int64) *NullableInt64 { return &NullableInt64{value: val, isSet: true} } func (v NullableInt64) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableInt64) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } type NullableFloat32 struct { value *float32 isSet bool } func (v NullableFloat32) Get() *float32 { return v.value } func (v *NullableFloat32) Set(val *float32) { v.value = val v.isSet = true } func (v NullableFloat32) IsSet() bool { return v.isSet } func (v *NullableFloat32) Unset() { v.value = nil v.isSet = false } func NewNullableFloat32(val *float32) *NullableFloat32 { return &NullableFloat32{value: val, isSet: true} } func (v NullableFloat32) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableFloat32) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } type NullableFloat64 struct { value *float64 isSet bool } func (v NullableFloat64) Get() *float64 { return v.value } func (v *NullableFloat64) Set(val *float64) { v.value = val v.isSet = true } func (v NullableFloat64) IsSet() bool { return v.isSet } func (v *NullableFloat64) Unset() { v.value = nil v.isSet = false } func NewNullableFloat64(val *float64) *NullableFloat64 { return &NullableFloat64{value: val, isSet: true} } func (v NullableFloat64) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableFloat64) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } type NullableString struct { value *string isSet bool } func (v NullableString) Get() *string { return v.value } func (v *NullableString) Set(val *string) { v.value = val v.isSet = true } func (v NullableString) IsSet() bool { return v.isSet } func (v *NullableString) Unset() { v.value = nil v.isSet = false } func NewNullableString(val *string) *NullableString { return &NullableString{value: val, isSet: true} } func (v NullableString) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableString) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } type NullableTime struct { value *time.Time isSet bool } func (v NullableTime) Get() *time.Time { return v.value } func (v *NullableTime) Set(val *time.Time) { v.value = val v.isSet = true } func (v NullableTime) IsSet() bool { return v.isSet } func (v *NullableTime) Unset() { v.value = nil v.isSet = false } func NewNullableTime(val *time.Time) *NullableTime { return &NullableTime{value: val, isSet: true} } func (v NullableTime) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableTime) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } // IsNil checks if an input is nil func IsNil(i interface{}) bool { if i == nil { return true } switch reflect.TypeOf(i).Kind() { case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: return reflect.ValueOf(i).IsNil() case reflect.Array: return reflect.ValueOf(i).IsZero() } return false } type MappedNullable interface { ToMap() (map[string]interface{}, error) } // A wrapper for strict JSON decoding func newStrictDecoder(data []byte) *json.Decoder { dec := json.NewDecoder(bytes.NewBuffer(data)) dec.DisallowUnknownFields() return dec } // Prevent trying to import "fmt" func reportError(format string, a ...interface{}) error { return fmt.Errorf(format, a...) } ================================================ FILE: openapi-spec.yml ================================================ components: schemas: Account: type: "object" properties: account_type: type: "string" created: type: "string" id: type: "string" license: type: "string" premium_data: type: "number" quota: type: "number" referral_count: type: "number" referral_renewal_countdown: type: "number" role: type: "string" updated: type: "string" warp_plus: type: "boolean" usage: type: "number" required: - "account_type" - "created" - "id" - "license" - "premium_data" - "quota" - "referral_count" - "referral_renewal_countdown" - "role" - "updated" - "warp_plus" BoundDevice: type: "object" properties: activated: type: "string" active: type: "boolean" created: type: "string" id: type: "string" model: type: "string" name: type: "string" role: type: "string" type: type: "string" required: - "activated" - "active" - "created" - "id" - "model" - "role" - "type" NetworkAddress: type: "object" properties: v4: type: "string" v6: type: "string" required: - "v4" - "v6" Endpoint: type: "object" properties: host: type: "string" v4: type: "string" v6: type: "string" required: - "host" - "v4" - "v6" Peer: type: "object" properties: endpoint: $ref: "#/components/schemas/Endpoint" public_key: type: "string" required: - "endpoint" - "public_key" Config: type: "object" properties: client_id: type: "string" interface: type: "object" properties: addresses: $ref: "#/components/schemas/NetworkAddress" required: - "addresses" peers: type: "array" items: $ref: "#/components/schemas/Peer" services: type: "object" properties: http_proxy: type: "string" required: - "http_proxy" required: - "client_id" - "interface" - "peers" - "services" SourceDevice: type: "object" properties: created: type: "string" enabled: type: "boolean" fcm_token: type: "string" id: type: "string" install_id: type: "string" key: type: "string" locale: type: "string" model: type: "string" name: type: "string" place: type: "number" tos: type: "string" type: type: "string" updated: type: "string" waitlist_enabled: type: "boolean" warp_enabled: type: "boolean" required: - "created" - "enabled" - "fcm_token" - "id" - "install_id" - "key" - "locale" - "model" - "name" - "place" - "tos" - "type" - "updated" - "waitlist_enabled" - "warp_enabled" IPv4Network: type: "object" properties: address: type: "string" netmask: type: "string" required: - "address" - "netmask" IPv6Network: type: "object" properties: address: type: "string" prefix: type: "number" required: - "address" - "prefix" GetAccount_200_Response: $ref: "#/components/schemas/Account" GetBoundDevices_200_Response: $ref: "#/components/schemas/BoundDevice" GetClientConfig_200_Response: type: "object" properties: captive_portal: type: "array" items: type: "object" properties: name: type: "string" networks: type: "array" items: type: "object" properties: address: type: "string" required: - "address" required: - "name" - "networks" denylist: type: "array" items: type: "object" properties: android-packages: type: "array" items: type: "string" name: type: "string" networks: type: "object" properties: v4: type: "array" items: $ref: "#/components/schemas/IPv4Network" v6: type: "array" items: $ref: "#/components/schemas/IPv6Network" required: - "v4" - "v6" visible: type: "boolean" required: - "name" - "visible" premium_data_bytes: type: "number" referral_reward_bytes: type: "number" required: - "captive_portal" - "denylist" - "premium_data_bytes" - "referral_reward_bytes" GetSourceDevice_200_Response: allOf: - $ref: "#/components/schemas/SourceDevice" - type: "object" properties: account: $ref: "#/components/schemas/Account" config: $ref: "#/components/schemas/Config" required: - "account" - "config" Register_200_Response: allOf: - $ref: "#/components/schemas/SourceDevice" - type: "object" properties: account: $ref: "#/components/schemas/Account" config: $ref: "#/components/schemas/Config" token: type: "string" required: - "account" - "config" - "token" Register_Request: type: "object" properties: fcm_token: type: "string" install_id: type: "string" key: type: "string" locale: type: "string" model: type: "string" tos: type: "string" type: type: "string" required: - "fcm_token" - "install_id" - "key" - "locale" - "model" - "tos" - "type" ResetAccountLicense_200_Response: type: "object" properties: license: type: "string" required: - "license" UpdateAccount_200_Response: type: "object" properties: created: type: "string" id: type: "string" premium_data: type: "number" quota: type: "number" referral_count: type: "number" referral_renewal_countdown: type: "number" role: type: "string" updated: type: "string" warp_plus: type: "boolean" required: - "created" - "id" - "premium_data" - "quota" - "referral_count" - "referral_renewal_countdown" - "role" - "updated" - "warp_plus" UpdateAccount_Request: type: "object" properties: license: type: "string" required: - "license" UpdateBoundDevice_200_Response: $ref: "#/components/schemas/BoundDevice" UpdateBoundDevice_Request: type: "object" properties: active: type: "boolean" name: type: "string" UpdateSourceDevice_200_Response: allOf: - $ref: "#/components/schemas/SourceDevice" - type: "object" properties: account: $ref: "#/components/schemas/Account" config: $ref: "#/components/schemas/Config" required: - "account" - "config" UpdateSourceDevice_Request: type: "object" properties: key: type: "string" required: - "key" info: title: "Cloudflare WARP API" version: "536" openapi: "3.0.1" paths: /{apiVersion}/client_config: get: operationId: "GetClientConfig" responses: 200: content: application/json: schema: $ref: "#/components/schemas/GetClientConfig_200_Response" description: "" summary: "GetClientConfig" parameters: - in: "path" name: "apiVersion" required: true schema: type: "string" /{apiVersion}/reg: parameters: - in: "path" name: "apiVersion" required: true schema: type: "string" post: operationId: "Register" requestBody: content: application/json: schema: $ref: "#/components/schemas/Register_Request" responses: 200: content: application/json: schema: $ref: "#/components/schemas/Register_200_Response" description: "" summary: "Register" /{apiVersion}/reg/{sourceDeviceId}: get: operationId: "GetSourceDevice" responses: 200: content: application/json: schema: $ref: "#/components/schemas/GetSourceDevice_200_Response" description: "" summary: "GetSourceDevice" parameters: - in: "path" name: "apiVersion" required: true schema: type: "string" - in: "path" name: "sourceDeviceId" required: true schema: type: "string" patch: operationId: "UpdateSourceDevice" requestBody: content: application/json: schema: $ref: "#/components/schemas/UpdateSourceDevice_Request" responses: 200: content: application/json: schema: $ref: "#/components/schemas/UpdateSourceDevice_200_Response" description: "" summary: "UpdateSourceDevice" /{apiVersion}/reg/{sourceDeviceId}/account: get: operationId: "GetAccount" responses: 200: content: application/json: schema: $ref: "#/components/schemas/GetAccount_200_Response" description: "" summary: "GetAccount" parameters: - in: "path" name: "sourceDeviceId" required: true schema: type: "string" - in: "path" name: "apiVersion" required: true schema: type: "string" put: operationId: "UpdateAccount" requestBody: content: application/json: schema: $ref: "#/components/schemas/UpdateAccount_Request" responses: 200: content: application/json: schema: $ref: "#/components/schemas/UpdateAccount_200_Response" description: "" summary: "UpdateAccount" /{apiVersion}/reg/{sourceDeviceId}/account/devices: get: operationId: "GetBoundDevices" responses: 200: content: application/json: schema: type: "array" items: $ref: "#/components/schemas/GetBoundDevices_200_Response" description: "" summary: "GetBoundDevices" parameters: - in: "path" name: "sourceDeviceId" required: true schema: type: "string" - in: "path" name: "apiVersion" required: true schema: type: "string" /{apiVersion}/reg/{sourceDeviceId}/account/license: parameters: - in: "path" name: "sourceDeviceId" required: true schema: type: "string" - in: "path" name: "apiVersion" required: true schema: type: "string" post: operationId: "ResetAccountLicense" responses: 200: content: application/json: schema: $ref: "#/components/schemas/ResetAccountLicense_200_Response" description: "" summary: "ResetAccountLicense" /{apiVersion}/reg/{sourceDeviceId}/account/reg/{boundDeviceId}: parameters: - in: "path" name: "sourceDeviceId" required: true schema: type: "string" - in: "path" name: "apiVersion" required: true schema: type: "string" - in: "path" name: "boundDeviceId" required: true schema: type: "string" patch: operationId: "UpdateBoundDevice" requestBody: content: application/json: schema: $ref: "#/components/schemas/UpdateBoundDevice_Request" responses: 200: content: application/json: schema: type: "array" items: $ref: "#/components/schemas/UpdateBoundDevice_200_Response" description: "" summary: "UpdateBoundDevice" delete: operationId: "DeleteBoundDevice" responses: 204: description: "" summary: "DeleteBoundDevice" ================================================ FILE: openapitools.json ================================================ { "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", "spaces": 2, "generator-cli": { "version": "7.14.0" } } ================================================ FILE: util/util.go ================================================ package util import ( "crypto/rand" "fmt" "time" ) func RandomHexString(count int) string { b := make([]byte, count) if _, err := rand.Read(b); err != nil { panic(err) } return fmt.Sprintf("%X", b) } func GetTimestamp() string { return getTimestamp(time.Now()) } func getTimestamp(t time.Time) string { timestamp := t.Format(time.RFC3339Nano) return timestamp } func IsHttp500Error(err error) bool { return err.Error() == "500 Internal Server Error" } ================================================ FILE: util/util_test.go ================================================ package util import ( "testing" "time" ) func TestGetTimestamp(t *testing.T) { expectedFormat := "2020-04-11T16:37:06.498+03:00" testTime := time.Date(2020, 04, 11, 16, 37, 06, 498*1000000, time.FixedZone("+3", 3*60*60)) testFormat := getTimestamp(testTime) if testFormat != expectedFormat { t.Error("Invalid timestamp") } } ================================================ FILE: wireguard/keys.go ================================================ /* SPDX-License-Identifier: MIT * * Copyright (C) 2019 WireGuard LLC. All Rights Reserved. */ // https://github.com/WireGuard/wireguard-windows/blob/master/conf/config.go package wireguard import ( "crypto/rand" "crypto/subtle" "encoding/base64" "github.com/cockroachdb/errors" "golang.org/x/crypto/curve25519" ) const KeyLength = 32 type Key [KeyLength]byte func (k *Key) String() string { return base64.StdEncoding.EncodeToString(k[:]) } func (k *Key) IsZero() bool { var zeros Key return subtle.ConstantTimeCompare(zeros[:], k[:]) == 1 } func (k *Key) Public() *Key { var p [KeyLength]byte curve25519.ScalarBaseMult(&p, (*[KeyLength]byte)(k)) return (*Key)(&p) } func NewPresharedKey() (*Key, error) { var k [KeyLength]byte _, err := rand.Read(k[:]) if err != nil { return nil, errors.WithStack(err) } return (*Key)(&k), nil } func NewPrivateKey() (*Key, error) { k, err := NewPresharedKey() if err != nil { return nil, errors.WithStack(err) } k[0] &= 248 k[31] = (k[31] & 127) | 64 return k, nil } func NewKey(base64Key string) (*Key, error) { k, err := base64.StdEncoding.DecodeString(base64Key) if err != nil { return nil, errors.WithStack(err) } var key Key copy(key[:], k) return &key, nil } ================================================ FILE: wireguard/keys_test.go ================================================ package wireguard import "testing" func TestNewKey(t *testing.T) { key, err := NewPrivateKey() if err != nil { t.Error(err) } encodedKey := key.String() newKey, err := NewKey(encodedKey) if err != nil { t.Error(err) } if newKey.String() != encodedKey { t.Error() } } ================================================ FILE: wireguard/profile.go ================================================ package wireguard import ( "bytes" "io/ioutil" "text/template" "github.com/cockroachdb/errors" ) var profileTemplate = `[Interface] PrivateKey = {{ .PrivateKey }} Address = {{ .Address1 }}/32, {{ .Address2 }}/128 DNS = 1.1.1.1, 1.0.0.1, 2606:4700:4700::1111, 2606:4700:4700::1001 MTU = 1280 [Peer] PublicKey = {{ .PublicKey }} AllowedIPs = 0.0.0.0/0, ::/0 Endpoint = {{ .Endpoint }} ` type Profile struct { profileString string } type ProfileData struct { PrivateKey string Address1 string Address2 string PublicKey string Endpoint string } func NewProfile(data *ProfileData) (*Profile, error) { profileString, err := generateProfile(data) if err != nil { return nil, errors.WithStack(err) } return &Profile{profileString: profileString}, nil } func generateProfile(data *ProfileData) (string, error) { t, err := template.New("").Parse(profileTemplate) if err != nil { return "", errors.WithStack(err) } var result bytes.Buffer if err := t.Execute(&result, data); err != nil { return "", errors.WithStack(err) } return result.String(), nil } func (p *Profile) Save(profileFile string) error { return ioutil.WriteFile(profileFile, []byte(p.profileString), 0600) } ================================================ FILE: wireguard/profile_test.go ================================================ package wireguard import "testing" func TestGenerateProfile(t *testing.T) { var expectedResult = `[Interface] PrivateKey = 1 Address = 2/32, 3/128 DNS = 1.1.1.1, 1.0.0.1, 2606:4700:4700::1111, 2606:4700:4700::1001 MTU = 1280 [Peer] PublicKey = 4 AllowedIPs = 0.0.0.0/0, ::/0 Endpoint = 5 ` result, err := generateProfile(&ProfileData{ PrivateKey: "1", Address1: "2", Address2: "3", PublicKey: "4", Endpoint: "5", }) if err != nil { t.Error(err) } if expectedResult != result { t.Error() } }