init
This commit is contained in:
commit
ba95c9e9e4
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
.idea/
|
||||
cmd/mully/mully
|
1
README.md
Normal file
1
README.md
Normal file
@ -0,0 +1 @@
|
||||
interact with the mullvad management interface via grpc+golang
|
204
cmd/mully/main.go
Normal file
204
cmd/mully/main.go
Normal file
@ -0,0 +1,204 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
"git.tcp.direct/kayos/zwrap"
|
||||
"github.com/rs/zerolog"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/connectivity"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
"google.golang.org/grpc/grpclog"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
"google.golang.org/protobuf/types/known/wrapperspb"
|
||||
|
||||
"git.tcp.direct/kayos/mully/pkg/mullvad_mgmt"
|
||||
)
|
||||
|
||||
func initConsoleLogger() *zwrap.Logger {
|
||||
zl := zerolog.New(zerolog.ConsoleWriter{
|
||||
Out: os.Stderr,
|
||||
FormatLevel: zwrap.LogLevelFmt(runtime.GOOS == "windows"),
|
||||
}).With().Timestamp().Logger()
|
||||
return zwrap.Wrap(zl)
|
||||
}
|
||||
|
||||
type RPCClient struct {
|
||||
*grpc.ClientConn
|
||||
log *zwrap.Logger
|
||||
hooker zerolog.Hook
|
||||
config *Config
|
||||
}
|
||||
|
||||
// because there's no need to export `Run`, this is a hack
|
||||
type logHooker struct {
|
||||
rpc *RPCClient
|
||||
}
|
||||
|
||||
func (h *logHooker) Run(e *zerolog.Event, level zerolog.Level, msg string) {
|
||||
h.rpc.hookRun(e, level, msg)
|
||||
}
|
||||
|
||||
func (r *RPCClient) hookRun(e *zerolog.Event, level zerolog.Level, msg string) {
|
||||
e.Str("state", r.GetState().String())
|
||||
e.Str("caller", r.CanonicalTarget())
|
||||
}
|
||||
|
||||
func NewRPCClient(c *Config) (*RPCClient, error) {
|
||||
client, err := grpc.NewClient(
|
||||
"unix:///var/run/mullvad-vpn",
|
||||
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to connect to the mullvad daemon: %w", err)
|
||||
}
|
||||
rpcc := &RPCClient{
|
||||
ClientConn: client,
|
||||
}
|
||||
rpcc.hooker = &logHooker{rpc: rpcc}
|
||||
rpcc.log = initConsoleLogger().WithForceLevel(zerolog.DebugLevel)
|
||||
rpcc.log.Hook(rpcc.hooker)
|
||||
grpclog.SetLoggerV2(rpcc.log)
|
||||
return rpcc, nil
|
||||
}
|
||||
|
||||
func (r *RPCClient) Close() error {
|
||||
return r.ClientConn.Close()
|
||||
}
|
||||
|
||||
func (r *RPCClient) stateWatcher(ctx context.Context, states chan<- connectivity.State, readyConn chan<- struct{}) {
|
||||
log := r.log
|
||||
last := connectivity.Idle
|
||||
for {
|
||||
if ok := r.ClientConn.WaitForStateChange(ctx, last); !ok {
|
||||
// expired context
|
||||
return
|
||||
}
|
||||
|
||||
last = r.GetState()
|
||||
states <- last
|
||||
|
||||
switch last {
|
||||
case connectivity.Ready:
|
||||
readyConn <- struct{}{}
|
||||
continue
|
||||
case connectivity.TransientFailure:
|
||||
log.Logger.Error().Msg("connection in transient failure state")
|
||||
case connectivity.Shutdown:
|
||||
log.Logger.Warn().Msg("connection in shutdown state")
|
||||
default:
|
||||
}
|
||||
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
}
|
||||
}
|
||||
|
||||
func (r *RPCClient) connect(ctx context.Context) error {
|
||||
log := r.log
|
||||
|
||||
states := make(chan connectivity.State, 1)
|
||||
readyConn := make(chan struct{}, 1)
|
||||
|
||||
go r.stateWatcher(ctx, states, readyConn)
|
||||
|
||||
waitLoop:
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
case <-states:
|
||||
log.Logger.Debug().Msg("state changed")
|
||||
case <-readyConn:
|
||||
log.Logger.Info().Msg("connection ready")
|
||||
break waitLoop
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *RPCClient) Connect(ctx context.Context) (mullvad_mgmt.ManagementServiceClient, error) {
|
||||
log := r.log
|
||||
|
||||
if err := r.connect(ctx); err != nil {
|
||||
return nil, fmt.Errorf("failed to connect to the gRPC endpoint: %w", err)
|
||||
}
|
||||
|
||||
serviceClient := mullvad_mgmt.NewManagementServiceClient(r.ClientConn)
|
||||
verStrPB, err := serviceClient.GetCurrentVersion(ctx, &emptypb.Empty{})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get current daemon version: %w", err)
|
||||
}
|
||||
|
||||
log.Logger.Info().Msgf("current daemon version: %s", verStrPB.Value)
|
||||
verPB, err := serviceClient.GetVersionInfo(ctx, &emptypb.Empty{})
|
||||
if err != nil {
|
||||
log.Logger.Fatal().Err(err).Msg("failed to get daemon version info")
|
||||
}
|
||||
log.Logger.Info().Msgf("daemon version info: %s", verPB.String())
|
||||
|
||||
return serviceClient, nil
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Account string
|
||||
}
|
||||
|
||||
func getConfig() (*Config, error) {
|
||||
if len(os.Args) < 2 && os.Getenv("MULLVAD_ACCOUNT") == "" {
|
||||
return nil, fmt.Errorf("no command specified")
|
||||
}
|
||||
if os.Getenv("MULLVAD_ACCOUNT") != "" {
|
||||
return &Config{Account: os.Getenv("MULLVAD_ACCOUNT")}, nil
|
||||
}
|
||||
return &Config{Account: os.Args[1]}, nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
checkProto(true)
|
||||
|
||||
tmpLog := initConsoleLogger()
|
||||
|
||||
conf, err := getConfig()
|
||||
if err != nil {
|
||||
tmpLog.Logger.Fatal().Err(err).Msg("missing mullvad account key")
|
||||
}
|
||||
client, err := NewRPCClient(conf)
|
||||
|
||||
if err != nil {
|
||||
tmpLog.Logger.Fatal().Err(err).Msg("failed to connect to the mullvad daemon")
|
||||
}
|
||||
|
||||
log := client.log
|
||||
defer func() {
|
||||
if err = client.Close(); err != nil {
|
||||
log.Logger.Error().Err(err).Msg("failed to close connection to the mullvad daemon")
|
||||
return
|
||||
}
|
||||
log.Logger.Debug().Msg("connection closed")
|
||||
}()
|
||||
|
||||
log.Logger.Debug().Msg("client initialized")
|
||||
|
||||
log.Logger.Debug().Msg("connecting...")
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
|
||||
var serviceClient mullvad_mgmt.ManagementServiceClient
|
||||
|
||||
if serviceClient, err = client.Connect(ctx); err != nil {
|
||||
log.Logger.Fatal().Err(err).Msg("failed to connect to the mullvad daemon")
|
||||
}
|
||||
|
||||
var acct *mullvad_mgmt.AccountData
|
||||
|
||||
if acct, err = serviceClient.GetAccountData(ctx, &wrapperspb.StringValue{Value: ""}); err != nil {
|
||||
log.Logger.Fatal().Err(err).Msg("failed to get account data")
|
||||
}
|
||||
|
||||
}
|
38
cmd/mully/proto.go
Normal file
38
cmd/mully/proto.go
Normal file
@ -0,0 +1,38 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/rs/zerolog"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
"git.tcp.direct/kayos/mully/pkg/mullvad_mgmt"
|
||||
)
|
||||
|
||||
var mProto = mullvad_mgmt.File_management_interface_proto
|
||||
|
||||
func checkProto(debug bool) protoreflect.ServiceDescriptor {
|
||||
if mProto.Services().Len() == 0 {
|
||||
panic("mullvad management interface proto has no services, did we forget to generate from pb?")
|
||||
}
|
||||
if mProto.Services().Len() > 1 {
|
||||
println(strings.Repeat("=", 80))
|
||||
for n := 0; n < mProto.Services().Len(); n++ {
|
||||
spew.Dump(mProto.Services().Get(n))
|
||||
}
|
||||
print(strings.Repeat("=", 80))
|
||||
panic("mullvad management interface proto has more than one service...!?")
|
||||
}
|
||||
if mProto.Services().Get(0).Methods().Len() == 0 {
|
||||
panic("mullvad management interface proto has no methods, did we forget to generate from pb?")
|
||||
}
|
||||
if debug {
|
||||
log := initConsoleLogger().WithForceLevel(zerolog.DebugLevel)
|
||||
slog := log.Logger.With().Str("caller", string(mProto.Services().Get(0).Name())).Logger()
|
||||
for n := 0; n < mProto.Services().Get(0).Methods().Len(); n++ {
|
||||
slog.Debug().Msgf("method %d: %s", n, mProto.Services().Get(0).Methods().Get(n).Name())
|
||||
}
|
||||
}
|
||||
return mProto.Services().Get(0)
|
||||
}
|
20
go.mod
Normal file
20
go.mod
Normal file
@ -0,0 +1,20 @@
|
||||
module git.tcp.direct/kayos/mully
|
||||
|
||||
go 1.22.2
|
||||
|
||||
require (
|
||||
git.tcp.direct/kayos/zwrap v0.6.1
|
||||
github.com/davecgh/go-spew v1.1.0
|
||||
github.com/rs/zerolog v1.32.0
|
||||
google.golang.org/grpc v1.64.0
|
||||
google.golang.org/protobuf v1.34.1
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
golang.org/x/net v0.22.0 // indirect
|
||||
golang.org/x/sys v0.20.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
|
||||
)
|
33
go.sum
Normal file
33
go.sum
Normal file
@ -0,0 +1,33 @@
|
||||
git.tcp.direct/kayos/zwrap v0.6.1 h1:y+qp1Nq3If0219DQurmYpVNrIZdm/n7hXQJtby49RN0=
|
||||
git.tcp.direct/kayos/zwrap v0.6.1/go.mod h1:Q2zdjRoeO5JgOxQmAnatAxpKTN665Ge8TBSbHTC1Azs=
|
||||
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
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/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
||||
github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0=
|
||||
github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
|
||||
golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc=
|
||||
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
|
||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
|
||||
google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY=
|
||||
google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg=
|
||||
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
|
||||
google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
41
pkg/mullvad_api/Makefile
Normal file
41
pkg/mullvad_api/Makefile
Normal file
@ -0,0 +1,41 @@
|
||||
API_BASE := https://api.mullvad.net
|
||||
OPENAPI_GEN_PROPS := isGoSubmodule=true,packageName=mullvad_api,withGoMod=false,generateInterfaces=true
|
||||
GET_SPEC_PATH = $(shell curl 'https://api.mullvad.net/app/documentation/' | grep spec-url | awk -F "'" '{print $$2}')
|
||||
SET_SPEC_PATH = $(eval SPEC_PATH=$(GET_SPEC_PATH))
|
||||
VERSION := "0.0.1"
|
||||
UAGENT = "mully/$(VERSION)"
|
||||
|
||||
all :: clean dep fetch gen prune
|
||||
|
||||
dep ::
|
||||
if ! openapi-generator-cli version 2>&1 > /dev/null; then npm install @openapitools/openapi-generator-cli -g; fi
|
||||
|
||||
fetch ::
|
||||
mkdir -p api
|
||||
$(SET_SPEC_PATH)
|
||||
SPEC_URL="$(API_BASE)$(SPEC_PATH)"; \
|
||||
curl "$$SPEC_URL" -o api/mullvad_api.yaml;
|
||||
|
||||
gen ::
|
||||
openapi-generator-cli generate \
|
||||
-g go \
|
||||
-i api/mullvad_api.yaml \
|
||||
--package-name mullvad_api \
|
||||
--api-package mullvad_api \
|
||||
--http-user-agent $(UAGENT) \
|
||||
-p $(OPENAPI_GEN_PROPS);
|
||||
|
||||
prune ::
|
||||
rm .openapi-generator-ignore 2>/dev/null || true
|
||||
rm .gitignore 2>/dev/null || true
|
||||
rm .travis.yml 2>/dev/null || true
|
||||
rm git_push.sh 2>/dev/null || true
|
||||
rm openapitools.json 2>/dev/null || true
|
||||
rm -r .openapi-generator 2>/dev/null || true
|
||||
|
||||
clean ::
|
||||
rm -r api 2>/dev/null || true
|
||||
rm -r docs 2>/dev/null || true
|
||||
rm -r test 2>/dev/null || true
|
||||
rm *.go 2>/dev/null || true
|
||||
rm README.md 2>/dev/null || true
|
178
pkg/mullvad_api/README.md
Normal file
178
pkg/mullvad_api/README.md
Normal file
@ -0,0 +1,178 @@
|
||||
# Go API client for mullvad_api
|
||||
|
||||
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: 1
|
||||
- Package version: 1.0.0
|
||||
- Generator version: 7.6.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 mullvad_api "github.com/GIT_USER_ID/GIT_REPO_ID/mullvad_api"
|
||||
```
|
||||
|
||||
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 `mullvad_api.ContextServerIndex` of type `int`.
|
||||
|
||||
```go
|
||||
ctx := context.WithValue(context.Background(), mullvad_api.ContextServerIndex, 1)
|
||||
```
|
||||
|
||||
### Templated Server URL
|
||||
|
||||
Templated server URL is formatted using default variables from configuration or from context value `mullvad_api.ContextServerVariables` of type `map[string]string`.
|
||||
|
||||
```go
|
||||
ctx := context.WithValue(context.Background(), mullvad_api.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 `mullvad_api.ContextOperationServerIndices` and `mullvad_api.ContextOperationServerVariables` context maps.
|
||||
|
||||
```go
|
||||
ctx := context.WithValue(context.Background(), mullvad_api.ContextOperationServerIndices, map[string]int{
|
||||
"{classname}Service.{nickname}": 2,
|
||||
})
|
||||
ctx = context.WithValue(context.Background(), mullvad_api.ContextOperationServerVariables, map[string]map[string]string{
|
||||
"{classname}Service.{nickname}": {
|
||||
"port": "8443",
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to */app*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*DefaultAPI* | [**V1AccountsPost**](docs/DefaultAPI.md#v1accountspost) | **Post** /v1/accounts | Create account
|
||||
*DefaultAPI* | [**V1ApiAddrsGet**](docs/DefaultAPI.md#v1apiaddrsget) | **Get** /v1/api-addrs | List IP addresses for reaching the API
|
||||
*DefaultAPI* | [**V1CreateApplePaymentPost**](docs/DefaultAPI.md#v1createapplepaymentpost) | **Post** /v1/create-apple-payment | Create an Apple In-App payment
|
||||
*DefaultAPI* | [**V1MeGet**](docs/DefaultAPI.md#v1meget) | **Get** /v1/me | Get info about account
|
||||
*DefaultAPI* | [**V1ProblemReportPost**](docs/DefaultAPI.md#v1problemreportpost) | **Post** /v1/problem-report | Submit a problem report
|
||||
*DefaultAPI* | [**V1RelaysGet**](docs/DefaultAPI.md#v1relaysget) | **Get** /v1/relays | Relay list
|
||||
*DefaultAPI* | [**V1ReleasesPlatformVersionGet**](docs/DefaultAPI.md#v1releasesplatformversionget) | **Get** /v1/releases/{platform}/{version} | Information about app release
|
||||
*DefaultAPI* | [**V1ReplaceWireguardKeyPost**](docs/DefaultAPI.md#v1replacewireguardkeypost) | **Post** /v1/replace-wireguard-key | Replace a WireGuard pubkey
|
||||
*DefaultAPI* | [**V1SubmitVoucherPost**](docs/DefaultAPI.md#v1submitvoucherpost) | **Post** /v1/submit-voucher | Submit a voucher
|
||||
*DefaultAPI* | [**V1WireguardKeysPost**](docs/DefaultAPI.md#v1wireguardkeyspost) | **Post** /v1/wireguard-keys | Add WireGuard public key
|
||||
*DefaultAPI* | [**V1WireguardKeysPubkeyDelete**](docs/DefaultAPI.md#v1wireguardkeyspubkeydelete) | **Delete** /v1/wireguard-keys/{pubkey} | Delete WireGuard public key
|
||||
*DefaultAPI* | [**V1WireguardKeysPubkeyGet**](docs/DefaultAPI.md#v1wireguardkeyspubkeyget) | **Get** /v1/wireguard-keys/{pubkey} | Get WireGuard public key
|
||||
*DefaultAPI* | [**V1WwwAuthTokenPost**](docs/DefaultAPI.md#v1wwwauthtokenpost) | **Post** /v1/www-auth-token | Request a website auth token (valid for 1 hour)
|
||||
|
||||
|
||||
## Documentation For Models
|
||||
|
||||
- [BridgeRelay](docs/BridgeRelay.md)
|
||||
- [ErrorSchema](docs/ErrorSchema.md)
|
||||
- [Location](docs/Location.md)
|
||||
- [OpenVpnRelay](docs/OpenVpnRelay.md)
|
||||
- [Relay](docs/Relay.md)
|
||||
- [V1CreateApplePaymentPostRequest](docs/V1CreateApplePaymentPostRequest.md)
|
||||
- [V1MeGet200Response](docs/V1MeGet200Response.md)
|
||||
- [V1ProblemReportPostRequest](docs/V1ProblemReportPostRequest.md)
|
||||
- [V1RelaysGet200Response](docs/V1RelaysGet200Response.md)
|
||||
- [V1RelaysGet200ResponseBridge](docs/V1RelaysGet200ResponseBridge.md)
|
||||
- [V1RelaysGet200ResponseBridgeShadowsocksInner](docs/V1RelaysGet200ResponseBridgeShadowsocksInner.md)
|
||||
- [V1RelaysGet200ResponseOpenvpn](docs/V1RelaysGet200ResponseOpenvpn.md)
|
||||
- [V1RelaysGet200ResponseOpenvpnPortsInner](docs/V1RelaysGet200ResponseOpenvpnPortsInner.md)
|
||||
- [V1RelaysGet200ResponseWireguard](docs/V1RelaysGet200ResponseWireguard.md)
|
||||
- [V1ReleasesPlatformVersionGet200Response](docs/V1ReleasesPlatformVersionGet200Response.md)
|
||||
- [V1ReplaceWireguardKeyPostRequest](docs/V1ReplaceWireguardKeyPostRequest.md)
|
||||
- [V1SubmitVoucherPost200Response](docs/V1SubmitVoucherPost200Response.md)
|
||||
- [V1SubmitVoucherPostRequest](docs/V1SubmitVoucherPostRequest.md)
|
||||
- [V1WireguardKeysPostRequest](docs/V1WireguardKeysPostRequest.md)
|
||||
- [V1WwwAuthTokenPost200Response](docs/V1WwwAuthTokenPost200Response.md)
|
||||
- [WireGuardPubkey](docs/WireGuardPubkey.md)
|
||||
- [WireGuardRelay](docs/WireGuardRelay.md)
|
||||
|
||||
|
||||
## Documentation For Authorization
|
||||
|
||||
|
||||
Authentication schemes defined for the API:
|
||||
### AccessToken
|
||||
|
||||
- **Type**: HTTP Bearer token authentication
|
||||
|
||||
Example
|
||||
|
||||
```go
|
||||
auth := context.WithValue(context.Background(), mullvad_api.ContextAccessToken, "BEARER_TOKEN_STRING")
|
||||
r, err := client.Service.Operation(auth, args)
|
||||
```
|
||||
|
||||
### TokenAuth
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: Authorization
|
||||
- **Location**: HTTP header
|
||||
|
||||
Note, each API key must be added to a map of `map[string]APIKey` where the key is: Authorization and passed in as the auth context for each request.
|
||||
|
||||
Example
|
||||
|
||||
```go
|
||||
auth := context.WithValue(
|
||||
context.Background(),
|
||||
mullvad_api.ContextAPIKeys,
|
||||
map[string]mullvad_api.APIKey{
|
||||
"Authorization": {Key: "API_KEY_STRING"},
|
||||
},
|
||||
)
|
||||
r, err := client.Service.Operation(auth, args)
|
||||
```
|
||||
|
||||
|
||||
## 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
|
||||
|
||||
|
||||
|
814
pkg/mullvad_api/api/mullvad_api.yaml
Normal file
814
pkg/mullvad_api/api/mullvad_api.yaml
Normal file
@ -0,0 +1,814 @@
|
||||
openapi: 3.0.1
|
||||
info:
|
||||
title: Mullvad App API
|
||||
version: "1"
|
||||
servers:
|
||||
- url: "/app"
|
||||
paths:
|
||||
/v1/relays:
|
||||
get:
|
||||
summary: Relay list
|
||||
responses:
|
||||
"200":
|
||||
description: Relay list
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
locations:
|
||||
type: object
|
||||
additionalProperties:
|
||||
$ref: '#/components/schemas/Location'
|
||||
openvpn:
|
||||
type: object
|
||||
properties:
|
||||
ports:
|
||||
description: "Pairs of port/protocol that will accept connections"
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
port:
|
||||
type: number
|
||||
protocol:
|
||||
type: string
|
||||
relays:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/OpenVpnRelay'
|
||||
wireguard:
|
||||
type: object
|
||||
properties:
|
||||
port_ranges:
|
||||
description: "List of port ranges that will accept connections"
|
||||
type: array
|
||||
items:
|
||||
type: array
|
||||
items:
|
||||
type: integer
|
||||
ipv4_gateway:
|
||||
description: The ipv4 gateway of the server, you can ping it to check whether a tunnel is connected or not.
|
||||
type: string
|
||||
ipv6_gateway:
|
||||
description: The ipv6 gateway of the server, you can ping it to check whether a tunnel is connected or not.
|
||||
type: string
|
||||
relays:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/WireGuardRelay'
|
||||
bridge:
|
||||
type: object
|
||||
properties:
|
||||
shadowsocks:
|
||||
description: "List of connection specs for Shadowsocks ports"
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
protocol:
|
||||
type: string
|
||||
port:
|
||||
type: integer
|
||||
cipher:
|
||||
type: string
|
||||
password:
|
||||
type: string
|
||||
relays:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/BridgeRelay'
|
||||
example:
|
||||
locations:
|
||||
se-got:
|
||||
city: Gothenburg
|
||||
country: Sweden
|
||||
latitude: 57.70887
|
||||
longitude: 11.97456
|
||||
se-sto:
|
||||
city: Stockholm
|
||||
country: Sweden
|
||||
latitude: 57.70887
|
||||
longitude: 11.97456
|
||||
openvpn:
|
||||
ports:
|
||||
- port: 1300
|
||||
protocol: udp
|
||||
- port: 443
|
||||
protocol: tcp
|
||||
relays:
|
||||
- hostname: se-got-001
|
||||
active: true
|
||||
owned: true
|
||||
location: se-got
|
||||
provider: "31173"
|
||||
ipv4_addr_in: 185.213.154.66
|
||||
weight: 100
|
||||
include_in_country: true
|
||||
wireguard:
|
||||
port_ranges:
|
||||
- [53, 53]
|
||||
- [123, 123]
|
||||
- [443, 443]
|
||||
- [4000, 33433]
|
||||
- [33565, 51820]
|
||||
- [52001, 60000]
|
||||
ipv4_gateway: '10.64.0.1'
|
||||
ipv6_gateway: 'fc00:bbbb:bbbb:bb01::1'
|
||||
relays:
|
||||
- hostname: se3-wireguard
|
||||
active: true
|
||||
owned: true
|
||||
location: se-got
|
||||
provider: "31173"
|
||||
ipv4_addr_in: 185.213.154.66
|
||||
ipv6_addr_in: 2a03:1b20:5:f011:31::a03f
|
||||
weight: 100
|
||||
include_in_country: true
|
||||
public_key: "5JMPeO7gXIbR5CnUa/NPNK4L5GqUnreF0/Bozai4pl4="
|
||||
bridge:
|
||||
shadowsocks:
|
||||
- protocol: tcp
|
||||
port: 443
|
||||
cipher: chacha20
|
||||
password: password
|
||||
relays:
|
||||
- hostname: se-sto-br-001
|
||||
active: true
|
||||
owned: true
|
||||
location: se-sto
|
||||
provider: "31173"
|
||||
ipv4_addr_in: 185.213.154.66
|
||||
weight: 100
|
||||
include_in_country: true
|
||||
"500":
|
||||
$ref: "#/components/responses/InternalServerError"
|
||||
|
||||
/v1/api-addrs:
|
||||
get:
|
||||
summary: List IP addresses for reaching the API
|
||||
responses:
|
||||
"200":
|
||||
description: 200 response
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
example:
|
||||
- '45.83.222.100:443'
|
||||
"500":
|
||||
$ref: "#/components/responses/InternalServerError"
|
||||
|
||||
/v1/me:
|
||||
get:
|
||||
summary: Get info about account
|
||||
deprecated: true
|
||||
security:
|
||||
- AccessToken: []
|
||||
- TokenAuth: []
|
||||
responses:
|
||||
"200":
|
||||
description: 200 response
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
token:
|
||||
type: string
|
||||
expires:
|
||||
type: string
|
||||
example:
|
||||
token: "1234123412341234"
|
||||
expires: "2020-02-28T12:49:20+00:00"
|
||||
"401":
|
||||
$ref: "#/components/responses/InvalidAuthError"
|
||||
"403":
|
||||
$ref: "#/components/responses/PermissionDeniedError"
|
||||
"500":
|
||||
$ref: "#/components/responses/InternalServerError"
|
||||
|
||||
/v1/accounts:
|
||||
post:
|
||||
summary: Create account
|
||||
deprecated: true
|
||||
responses:
|
||||
"201":
|
||||
description: 201 response
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
token:
|
||||
type: string
|
||||
expires:
|
||||
type: string
|
||||
example:
|
||||
token: "1234123412341234"
|
||||
expires: "2020-02-28T12:49:20+00:00"
|
||||
"500":
|
||||
$ref: "#/components/responses/InternalServerError"
|
||||
|
||||
/v1/submit-voucher:
|
||||
post:
|
||||
summary: Submit a voucher
|
||||
security:
|
||||
- AccessToken:
|
||||
- TokenAuth: []
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
voucher_code:
|
||||
type: string
|
||||
required:
|
||||
- voucher_code
|
||||
example:
|
||||
voucher_code: ABCD-EFGH-1234-5678
|
||||
responses:
|
||||
"200":
|
||||
description: 200 response
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
time_added:
|
||||
type: number
|
||||
new_expiry:
|
||||
type: string
|
||||
example:
|
||||
time_added: 2592000
|
||||
new_expiry: "2020-02-28T12:49:20+00:00"
|
||||
"400":
|
||||
description: Error when submitting voucher
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/ErrorSchema"
|
||||
examples:
|
||||
MISSING_ARGUMENT:
|
||||
value:
|
||||
code: 'MISSING_ARGUMENT'
|
||||
error: 'One of the required arguments is missing from the request body'
|
||||
INVALID_VOUCHER:
|
||||
value:
|
||||
code: 'INVALID_VOUCHER'
|
||||
error: 'This voucher code is invalid'
|
||||
VOUCHER_USED:
|
||||
value:
|
||||
code: 'VOUCHER_USED'
|
||||
error: 'This voucher code has already been used'
|
||||
"401":
|
||||
$ref: "#/components/responses/InvalidAuthError"
|
||||
"403":
|
||||
$ref: "#/components/responses/PermissionDeniedError"
|
||||
"500":
|
||||
$ref: "#/components/responses/InternalServerError"
|
||||
|
||||
/v1/problem-report:
|
||||
post:
|
||||
summary: Submit a problem report
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
address:
|
||||
type: string
|
||||
message:
|
||||
type: string
|
||||
log:
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
required:
|
||||
- log
|
||||
- metadata
|
||||
responses:
|
||||
"204":
|
||||
description: 204 response
|
||||
"500":
|
||||
$ref: "#/components/responses/InternalServerError"
|
||||
|
||||
|
||||
/v1/www-auth-token:
|
||||
post:
|
||||
summary: Request a website auth token (valid for 1 hour)
|
||||
security:
|
||||
- AccessToken:
|
||||
- TokenAuth: []
|
||||
responses:
|
||||
"200":
|
||||
description: 200 response
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
auth_token:
|
||||
type: string
|
||||
example:
|
||||
auth_token: 767b3b8d63944e5ab8751c382ad3b30f
|
||||
"401":
|
||||
$ref: "#/components/responses/InvalidAuthError"
|
||||
"403":
|
||||
$ref: "#/components/responses/PermissionDeniedError"
|
||||
"500":
|
||||
$ref: "#/components/responses/InternalServerError"
|
||||
|
||||
|
||||
/v1/releases/{platform}/{version}:
|
||||
get:
|
||||
summary: Information about app release
|
||||
parameters:
|
||||
- name: platform
|
||||
in: path
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
- name: version
|
||||
in: path
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: 200 response
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
supported:
|
||||
type: boolean
|
||||
latest:
|
||||
type: string
|
||||
nullable: true
|
||||
latest_stable:
|
||||
type: string
|
||||
nullable: true
|
||||
latest_beta:
|
||||
type: string
|
||||
nullable: true
|
||||
example:
|
||||
supported: true
|
||||
latest: "2020.3"
|
||||
latest_stable: "2020.3"
|
||||
latest_beta: "2020.4-beta1"
|
||||
"404":
|
||||
description: "Release not found"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/ErrorSchema"
|
||||
example:
|
||||
code: "RELEASE_NOT_FOUND"
|
||||
"500":
|
||||
$ref: "#/components/responses/InternalServerError"
|
||||
|
||||
/v1/wireguard-keys:
|
||||
post:
|
||||
summary: Add WireGuard public key
|
||||
deprecated: true
|
||||
security:
|
||||
- AccessToken:
|
||||
- TokenAuth: []
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
pubkey:
|
||||
type: string
|
||||
description: The WireGuard public key to add
|
||||
required:
|
||||
- pubkey
|
||||
example:
|
||||
pubkey: abdXKwUtjpSJTAA5lLphhUqfmDP8G/SK78uH9NG0rC0=
|
||||
responses:
|
||||
"201":
|
||||
description: 201 response
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/WireGuardPubkey"
|
||||
example:
|
||||
id: abdXKwUtjpSJTAA5lLphhUqfmDP8G%2FSK78uH9NG0rC0%3D
|
||||
pubkey: abdXKwUtjpSJTAA5lLphhUqfmDP8G/SK78uH9NG0rC0=
|
||||
ipv4_address: 10.99.0.1/32
|
||||
ipv6_address: 'fc00:bbbb:bbbb:bb01::1/128'
|
||||
"400":
|
||||
description: Error when adding a WireGuard key
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/ErrorSchema"
|
||||
examples:
|
||||
MISSING_ARGUMENT:
|
||||
value:
|
||||
code: 'MISSING_ARGUMENT'
|
||||
error: 'One of the required arguments is missing from the request body'
|
||||
INVALID_PUBKEY:
|
||||
value:
|
||||
code: 'INVALID_PUBKEY'
|
||||
error: '"pubkey" is not a valid WireGuard public key'
|
||||
KEY_LIMIT_REACHED:
|
||||
value:
|
||||
code: 'KEY_LIMIT_REACHED'
|
||||
error: 'Account already has the maximum number of devices'
|
||||
PUBKEY_IN_USE:
|
||||
value:
|
||||
code: 'PUBKEY_IN_USE'
|
||||
error: 'WireGuard public key in use by other account'
|
||||
"401":
|
||||
$ref: "#/components/responses/InvalidAuthError"
|
||||
"403":
|
||||
$ref: "#/components/responses/PermissionDeniedError"
|
||||
"500":
|
||||
$ref: "#/components/responses/InternalServerError"
|
||||
|
||||
/v1/wireguard-keys/{pubkey}:
|
||||
get:
|
||||
summary: Get WireGuard public key
|
||||
deprecated: true
|
||||
security:
|
||||
- AccessToken:
|
||||
- TokenAuth: []
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/WireGuardPubKey"
|
||||
responses:
|
||||
"200":
|
||||
description: 200 response
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/WireGuardPubkey"
|
||||
example:
|
||||
ipv4_address: 10.99.0.1/32
|
||||
ipv6_address: 'fc00:bbbb:bbbb:bb01::1/128'
|
||||
id: abdXKwUtjpSJTAA5lLphhUqfmDP8G%2FSK78uH9NG0rC0%3D
|
||||
pubkey: abdXKwUtjpSJTAA5lLphhUqfmDP8G/SK78uH9NG0rC0=
|
||||
|
||||
"404":
|
||||
description: "WireGuard key error"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/ErrorSchema"
|
||||
examples:
|
||||
PUBKEY_NOT_FOUND:
|
||||
value:
|
||||
code: 'PUBKEY_NOT_FOUND'
|
||||
error: 'The requested pubkey does not exist'
|
||||
"401":
|
||||
$ref: "#/components/responses/InvalidAuthError"
|
||||
"403":
|
||||
$ref: "#/components/responses/PermissionDeniedError"
|
||||
"500":
|
||||
$ref: "#/components/responses/InternalServerError"
|
||||
|
||||
delete:
|
||||
summary: Delete WireGuard public key
|
||||
deprecated: true
|
||||
security:
|
||||
- AccessToken:
|
||||
- TokenAuth: []
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/WireGuardPubKey"
|
||||
responses:
|
||||
"204":
|
||||
description: 204 response
|
||||
"404":
|
||||
description: "WireGuard key error"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/ErrorSchema"
|
||||
examples:
|
||||
PUBKEY_NOT_FOUND:
|
||||
value:
|
||||
code: 'PUBKEY_NOT_FOUND'
|
||||
error: 'The requested pubkey does not exist'
|
||||
"401":
|
||||
$ref: "#/components/responses/InvalidAuthError"
|
||||
"403":
|
||||
$ref: "#/components/responses/PermissionDeniedError"
|
||||
"500":
|
||||
$ref: "#/components/responses/InternalServerError"
|
||||
|
||||
/v1/replace-wireguard-key:
|
||||
post:
|
||||
summary: Replace a WireGuard pubkey
|
||||
deprecated: true
|
||||
security:
|
||||
- AccessToken:
|
||||
- TokenAuth: []
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
old:
|
||||
type: string
|
||||
description: The WireGuard public key to remove
|
||||
new:
|
||||
type: string
|
||||
description: The WireGuard public key to add
|
||||
required:
|
||||
- old
|
||||
- new
|
||||
example:
|
||||
old: "abdXKwUtjpSJTAA5lLphhUqfmDP8G/SK78uH9NG0rC0="
|
||||
new: "veGD6/aEY6sMfN3Ls7YWPmNgu3AheO7nQqsFT47YSws="
|
||||
responses:
|
||||
"200":
|
||||
description: "The new key already exists on the account"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/WireGuardPubkey"
|
||||
example:
|
||||
id: abdXKwUtjpSJTAA5lLphhUqfmDP8G%2FSK78uH9NG0rC0%3D
|
||||
pubkey: abdXKwUtjpSJTAA5lLphhUqfmDP8G/SK78uH9NG0rC0=
|
||||
ipv4_address: 10.99.0.1/32
|
||||
ipv6_address: 'fc00:bbbb:bbbb:bb01::1/128'
|
||||
"201":
|
||||
description: "The old key was removed and the new key was added"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/WireGuardPubkey"
|
||||
example:
|
||||
id: abdXKwUtjpSJTAA5lLphhUqfmDP8G%2FSK78uH9NG0rC0%3D
|
||||
pubkey: abdXKwUtjpSJTAA5lLphhUqfmDP8G/SK78uH9NG0rC0=
|
||||
ipv4_address: 10.99.0.1/32
|
||||
ipv6_address: 'fc00:bbbb:bbbb:bb01::1/128'
|
||||
"400":
|
||||
description: Error when replacing a WireGuard key
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/ErrorSchema"
|
||||
examples:
|
||||
MISSING_ARGUMENT:
|
||||
value:
|
||||
code: 'MISSING_ARGUMENT'
|
||||
error: 'One of the required arguments is missing from the request body'
|
||||
INVALID_PUBKEY:
|
||||
value:
|
||||
code: 'INVALID_PUBKEY'
|
||||
error: '"new" is not a valid WireGuard public key'
|
||||
PUBKEY_IN_USE:
|
||||
value:
|
||||
code: 'PUBKEY_IN_USE'
|
||||
error: 'WireGuard public key in use by other account'
|
||||
RELAY_PUBKEY:
|
||||
value:
|
||||
code: 'RELAY_PUBKEY'
|
||||
error: 'WireGuard public key in use by a relay'
|
||||
KEY_LIMIT_REACHED:
|
||||
value:
|
||||
code: 'KEY_LIMIT_REACHED'
|
||||
error: 'Account already has the maximum number of devices'
|
||||
|
||||
"401":
|
||||
$ref: "#/components/responses/InvalidAuthError"
|
||||
"403":
|
||||
$ref: "#/components/responses/PermissionDeniedError"
|
||||
"500":
|
||||
$ref: "#/components/responses/InternalServerError"
|
||||
|
||||
/v1/create-apple-payment:
|
||||
post:
|
||||
summary: Create an Apple In-App payment
|
||||
security:
|
||||
- AccessToken:
|
||||
- TokenAuth: []
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
receipt_string:
|
||||
type: string
|
||||
description: An encrypted Base64-encoded App Store receipt
|
||||
required:
|
||||
- receipt_string
|
||||
responses:
|
||||
"200":
|
||||
description: All transactions in the receipt already exists and no time was added
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
time_added:
|
||||
type: number
|
||||
new_expiry:
|
||||
type: string
|
||||
example:
|
||||
time_added: 0
|
||||
new_expiry: "2020-02-28T12:49:20+00:00"
|
||||
"201":
|
||||
description: New transaction(s) have been added and account expiry updated
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
time_added:
|
||||
type: number
|
||||
new_expiry:
|
||||
type: string
|
||||
example:
|
||||
time_added: 2592000
|
||||
new_expiry: "2020-02-28T12:49:20+00:00"
|
||||
"400":
|
||||
description: Error when making an Apple In-App payment
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/ErrorSchema"
|
||||
examples:
|
||||
MISSING_ARGUMENT:
|
||||
value:
|
||||
code: 'MISSING_ARGUMENT'
|
||||
error: 'One of the required arguments is missing from the request body'
|
||||
APPLE_PRODUCT_DOES_NOT_EXIST:
|
||||
value:
|
||||
code: 'APPLE_PRODUCT_DOES_NOT_EXIST'
|
||||
error: 'A selected product does not exist'
|
||||
APPLE_RECEIPT_ERROR:
|
||||
value:
|
||||
code: 'APPLE_RECEIPT_ERROR'
|
||||
error: 'The Apple receipt is not valid'
|
||||
"401":
|
||||
$ref: "#/components/responses/InvalidAuthError"
|
||||
"403":
|
||||
$ref: "#/components/responses/PermissionDeniedError"
|
||||
"500":
|
||||
description: Internal error when making an Apple In-App payment
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/ErrorSchema"
|
||||
examples:
|
||||
APPLE_SERVER_CONNECTION_ERROR:
|
||||
value:
|
||||
code: 'APPLE_SERVER_CONNECTION_ERROR'
|
||||
error: "A problem occurred when connecting to the Apple server"
|
||||
INTERNAL_ERROR:
|
||||
value:
|
||||
code: 'INTERNAL_ERROR'
|
||||
error: "Internal server error"
|
||||
|
||||
components:
|
||||
securitySchemes:
|
||||
AccessToken:
|
||||
type: http
|
||||
scheme: Bearer
|
||||
TokenAuth:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: Authorization
|
||||
description: '**DEPRECATED** The client must send "Token {account_token}" in the Authorization header.'
|
||||
parameters:
|
||||
WireGuardPubKey:
|
||||
in: path
|
||||
name: pubkey
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
description: The WireGuard public key, urlencoded.
|
||||
|
||||
schemas:
|
||||
ErrorSchema:
|
||||
type: object
|
||||
properties:
|
||||
code:
|
||||
type: string
|
||||
description: The error code.
|
||||
error:
|
||||
type: string
|
||||
description: The error message.
|
||||
|
||||
Location:
|
||||
type: object
|
||||
properties:
|
||||
city:
|
||||
type: string
|
||||
country:
|
||||
type: string
|
||||
latitude:
|
||||
type: number
|
||||
longitude:
|
||||
type: number
|
||||
|
||||
WireGuardPubkey:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Convenience field with the public key encoded to use with the API (eg when deleting it), same as the pubkey field but urlencoded.
|
||||
pubkey:
|
||||
type: string
|
||||
description: The WireGuard public key.
|
||||
ipv4_address:
|
||||
type: string
|
||||
description: The ipv4 peer adress for WireGuard. Note that the mask may be bigger then a single IP.
|
||||
ipv6_address:
|
||||
type: string
|
||||
description: The ipv6 peer address for WireGuard. Note that the mask may be bigger then a single IP.
|
||||
|
||||
Relay:
|
||||
type: object
|
||||
properties:
|
||||
hostname:
|
||||
type: string
|
||||
location:
|
||||
type: string
|
||||
active:
|
||||
type: boolean
|
||||
owned:
|
||||
type: boolean
|
||||
provider:
|
||||
type: string
|
||||
ipv4_addr_in:
|
||||
type: string
|
||||
include_in_country:
|
||||
type: boolean
|
||||
weight:
|
||||
type: integer
|
||||
|
||||
OpenVpnRelay:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/Relay'
|
||||
|
||||
WireGuardRelay:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/Relay'
|
||||
- properties:
|
||||
public_key:
|
||||
type: string
|
||||
ipv6_addr_in:
|
||||
type: string
|
||||
same_ip:
|
||||
description: >
|
||||
Whether the server supports clients using the same IP address.
|
||||
This flag will be removed once all servers support the feature,
|
||||
so clients should default to True if it's missing.
|
||||
type: boolean
|
||||
default: true
|
||||
daita:
|
||||
description: >
|
||||
If true, clients can expect DAITA to be available on this relay.
|
||||
Note that this field is not guaranteed to be present. A missing
|
||||
`daita` property is semantically equivalent to `"daita": false`.
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
BridgeRelay:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/Relay'
|
||||
|
||||
|
||||
responses:
|
||||
InvalidAuthError:
|
||||
description: Access token is missing or invalid.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorSchema'
|
||||
example:
|
||||
code: 'INVALID_AUTH'
|
||||
error: 'Invalid auth header'
|
||||
|
||||
PermissionDeniedError:
|
||||
description: Permission denied
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorSchema'
|
||||
example:
|
||||
code: 'INVALID_ACCOUNT'
|
||||
error: 'Invalid Mullvad account'
|
||||
|
||||
InternalServerError:
|
||||
description: Internal server error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorSchema'
|
||||
example:
|
||||
code: 'INTERNAL_ERROR'
|
||||
error: 'Internal server error'
|
1261
pkg/mullvad_api/api/openapi.yaml
Normal file
1261
pkg/mullvad_api/api/openapi.yaml
Normal file
File diff suppressed because it is too large
Load Diff
2011
pkg/mullvad_api/api_default.go
Normal file
2011
pkg/mullvad_api/api_default.go
Normal file
File diff suppressed because it is too large
Load Diff
665
pkg/mullvad_api/client.go
Normal file
665
pkg/mullvad_api/client.go
Normal file
@ -0,0 +1,665 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
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 Mullvad App API API v1
|
||||
// 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 DefaultAPI
|
||||
}
|
||||
|
||||
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 {
|
||||
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{}, 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, collectionType)
|
||||
return
|
||||
}
|
||||
if t, ok := obj.(time.Time); ok {
|
||||
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), 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<lenIndValue;i++ {
|
||||
var arrayValue = indValue.Index(i)
|
||||
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, arrayValue.Interface(), collectionType)
|
||||
}
|
||||
return
|
||||
|
||||
case reflect.Map:
|
||||
var indValue = reflect.ValueOf(obj)
|
||||
if indValue == reflect.ValueOf(nil) {
|
||||
return
|
||||
}
|
||||
iter := indValue.MapRange()
|
||||
for iter.Next() {
|
||||
k,v := iter.Key(), iter.Value()
|
||||
parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), collectionType)
|
||||
}
|
||||
return
|
||||
|
||||
case reflect.Interface:
|
||||
fallthrough
|
||||
case reflect.Ptr:
|
||||
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), collectionType)
|
||||
return
|
||||
|
||||
case reflect.Int, reflect.Int8, reflect.Int16,
|
||||
reflect.Int32, reflect.Int64:
|
||||
value = strconv.FormatInt(v.Int(), 10)
|
||||
case reflect.Uint, reflect.Uint8, reflect.Uint16,
|
||||
reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
||||
value = strconv.FormatUint(v.Uint(), 10)
|
||||
case reflect.Float32, reflect.Float64:
|
||||
value = strconv.FormatFloat(v.Float(), 'g', -1, 32)
|
||||
case reflect.Bool:
|
||||
value = strconv.FormatBool(v.Bool())
|
||||
case reflect.String:
|
||||
value = v.String()
|
||||
default:
|
||||
value = v.Type().String() + " value"
|
||||
}
|
||||
}
|
||||
|
||||
switch valuesMap := headerOrQueryParams.(type) {
|
||||
case url.Values:
|
||||
if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" {
|
||||
valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix) + "," + value)
|
||||
} else {
|
||||
valuesMap.Add(keyPrefix, value)
|
||||
}
|
||||
break
|
||||
case map[string]string:
|
||||
valuesMap[keyPrefix] = value
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// helper for converting interface{} parameters to json strings
|
||||
func parameterToJson(obj interface{}) (string, error) {
|
||||
jsonBuf, err := json.Marshal(obj)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(jsonBuf), err
|
||||
}
|
||||
|
||||
// callAPI do the request.
|
||||
func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) {
|
||||
if c.cfg.Debug {
|
||||
dump, err := httputil.DumpRequestOut(request, true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
log.Printf("\n%s\n", string(dump))
|
||||
}
|
||||
|
||||
resp, err := c.cfg.HTTPClient.Do(request)
|
||||
if err != nil {
|
||||
return resp, err
|
||||
}
|
||||
|
||||
if c.cfg.Debug {
|
||||
dump, err := httputil.DumpResponse(resp, true)
|
||||
if err != nil {
|
||||
return resp, err
|
||||
}
|
||||
log.Printf("\n%s\n", string(dump))
|
||||
}
|
||||
return resp, err
|
||||
}
|
||||
|
||||
// Allow modification of underlying config for alternate implementations and testing
|
||||
// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior
|
||||
func (c *APIClient) GetConfig() *Configuration {
|
||||
return c.cfg
|
||||
}
|
||||
|
||||
type formFile struct {
|
||||
fileBytes []byte
|
||||
fileName string
|
||||
formFileName string
|
||||
}
|
||||
|
||||
// prepareRequest build the request
|
||||
func (c *APIClient) prepareRequest(
|
||||
ctx context.Context,
|
||||
path string, method string,
|
||||
postBody interface{},
|
||||
headerParams map[string]string,
|
||||
queryParams url.Values,
|
||||
formParams url.Values,
|
||||
formFiles []formFile) (localVarRequest *http.Request, err error) {
|
||||
|
||||
var body *bytes.Buffer
|
||||
|
||||
// Detect postBody type and post.
|
||||
if postBody != nil {
|
||||
contentType := headerParams["Content-Type"]
|
||||
if contentType == "" {
|
||||
contentType = detectContentType(postBody)
|
||||
headerParams["Content-Type"] = contentType
|
||||
}
|
||||
|
||||
body, err = setBody(postBody, contentType)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
// add form parameters and file if available.
|
||||
if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 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.
|
||||
|
||||
// AccessToken Authentication
|
||||
if auth, ok := ctx.Value(ContextAccessToken).(string); ok {
|
||||
localVarRequest.Header.Add("Authorization", "Bearer "+auth)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
// Prevent trying to import "fmt"
|
||||
func reportError(format string, a ...interface{}) error {
|
||||
return fmt.Errorf(format, a...)
|
||||
}
|
||||
|
||||
// A wrapper for strict JSON decoding
|
||||
func newStrictDecoder(data []byte) *json.Decoder {
|
||||
dec := json.NewDecoder(bytes.NewBuffer(data))
|
||||
dec.DisallowUnknownFields()
|
||||
return dec
|
||||
}
|
||||
|
||||
// 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))
|
||||
}
|
221
pkg/mullvad_api/configuration.go
Normal file
221
pkg/mullvad_api/configuration.go
Normal file
@ -0,0 +1,221 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
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 (
|
||||
// ContextAccessToken takes a string oauth2 access token as authentication for the request.
|
||||
ContextAccessToken = contextKey("accesstoken")
|
||||
|
||||
// ContextAPIKeys takes a string apikey as authentication for the request
|
||||
ContextAPIKeys = contextKey("apiKeys")
|
||||
|
||||
// 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: "mully/0.0.1",
|
||||
Debug: false,
|
||||
Servers: ServerConfigurations{
|
||||
{
|
||||
URL: "/app",
|
||||
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)
|
||||
}
|
238
pkg/mullvad_api/docs/BridgeRelay.md
Normal file
238
pkg/mullvad_api/docs/BridgeRelay.md
Normal file
@ -0,0 +1,238 @@
|
||||
# BridgeRelay
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Hostname** | Pointer to **string** | | [optional]
|
||||
**Location** | Pointer to **string** | | [optional]
|
||||
**Active** | Pointer to **bool** | | [optional]
|
||||
**Owned** | Pointer to **bool** | | [optional]
|
||||
**Provider** | Pointer to **string** | | [optional]
|
||||
**Ipv4AddrIn** | Pointer to **string** | | [optional]
|
||||
**IncludeInCountry** | Pointer to **bool** | | [optional]
|
||||
**Weight** | Pointer to **int32** | | [optional]
|
||||
|
||||
## Methods
|
||||
|
||||
### NewBridgeRelay
|
||||
|
||||
`func NewBridgeRelay() *BridgeRelay`
|
||||
|
||||
NewBridgeRelay instantiates a new BridgeRelay 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
|
||||
|
||||
### NewBridgeRelayWithDefaults
|
||||
|
||||
`func NewBridgeRelayWithDefaults() *BridgeRelay`
|
||||
|
||||
NewBridgeRelayWithDefaults instantiates a new BridgeRelay 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
|
||||
|
||||
### GetHostname
|
||||
|
||||
`func (o *BridgeRelay) GetHostname() string`
|
||||
|
||||
GetHostname returns the Hostname field if non-nil, zero value otherwise.
|
||||
|
||||
### GetHostnameOk
|
||||
|
||||
`func (o *BridgeRelay) GetHostnameOk() (*string, bool)`
|
||||
|
||||
GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetHostname
|
||||
|
||||
`func (o *BridgeRelay) SetHostname(v string)`
|
||||
|
||||
SetHostname sets Hostname field to given value.
|
||||
|
||||
### HasHostname
|
||||
|
||||
`func (o *BridgeRelay) HasHostname() bool`
|
||||
|
||||
HasHostname returns a boolean if a field has been set.
|
||||
|
||||
### GetLocation
|
||||
|
||||
`func (o *BridgeRelay) GetLocation() string`
|
||||
|
||||
GetLocation returns the Location field if non-nil, zero value otherwise.
|
||||
|
||||
### GetLocationOk
|
||||
|
||||
`func (o *BridgeRelay) GetLocationOk() (*string, bool)`
|
||||
|
||||
GetLocationOk returns a tuple with the Location field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetLocation
|
||||
|
||||
`func (o *BridgeRelay) SetLocation(v string)`
|
||||
|
||||
SetLocation sets Location field to given value.
|
||||
|
||||
### HasLocation
|
||||
|
||||
`func (o *BridgeRelay) HasLocation() bool`
|
||||
|
||||
HasLocation returns a boolean if a field has been set.
|
||||
|
||||
### GetActive
|
||||
|
||||
`func (o *BridgeRelay) GetActive() bool`
|
||||
|
||||
GetActive returns the Active field if non-nil, zero value otherwise.
|
||||
|
||||
### GetActiveOk
|
||||
|
||||
`func (o *BridgeRelay) 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 *BridgeRelay) SetActive(v bool)`
|
||||
|
||||
SetActive sets Active field to given value.
|
||||
|
||||
### HasActive
|
||||
|
||||
`func (o *BridgeRelay) HasActive() bool`
|
||||
|
||||
HasActive returns a boolean if a field has been set.
|
||||
|
||||
### GetOwned
|
||||
|
||||
`func (o *BridgeRelay) GetOwned() bool`
|
||||
|
||||
GetOwned returns the Owned field if non-nil, zero value otherwise.
|
||||
|
||||
### GetOwnedOk
|
||||
|
||||
`func (o *BridgeRelay) GetOwnedOk() (*bool, bool)`
|
||||
|
||||
GetOwnedOk returns a tuple with the Owned field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetOwned
|
||||
|
||||
`func (o *BridgeRelay) SetOwned(v bool)`
|
||||
|
||||
SetOwned sets Owned field to given value.
|
||||
|
||||
### HasOwned
|
||||
|
||||
`func (o *BridgeRelay) HasOwned() bool`
|
||||
|
||||
HasOwned returns a boolean if a field has been set.
|
||||
|
||||
### GetProvider
|
||||
|
||||
`func (o *BridgeRelay) GetProvider() string`
|
||||
|
||||
GetProvider returns the Provider field if non-nil, zero value otherwise.
|
||||
|
||||
### GetProviderOk
|
||||
|
||||
`func (o *BridgeRelay) GetProviderOk() (*string, bool)`
|
||||
|
||||
GetProviderOk returns a tuple with the Provider field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetProvider
|
||||
|
||||
`func (o *BridgeRelay) SetProvider(v string)`
|
||||
|
||||
SetProvider sets Provider field to given value.
|
||||
|
||||
### HasProvider
|
||||
|
||||
`func (o *BridgeRelay) HasProvider() bool`
|
||||
|
||||
HasProvider returns a boolean if a field has been set.
|
||||
|
||||
### GetIpv4AddrIn
|
||||
|
||||
`func (o *BridgeRelay) GetIpv4AddrIn() string`
|
||||
|
||||
GetIpv4AddrIn returns the Ipv4AddrIn field if non-nil, zero value otherwise.
|
||||
|
||||
### GetIpv4AddrInOk
|
||||
|
||||
`func (o *BridgeRelay) GetIpv4AddrInOk() (*string, bool)`
|
||||
|
||||
GetIpv4AddrInOk returns a tuple with the Ipv4AddrIn field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetIpv4AddrIn
|
||||
|
||||
`func (o *BridgeRelay) SetIpv4AddrIn(v string)`
|
||||
|
||||
SetIpv4AddrIn sets Ipv4AddrIn field to given value.
|
||||
|
||||
### HasIpv4AddrIn
|
||||
|
||||
`func (o *BridgeRelay) HasIpv4AddrIn() bool`
|
||||
|
||||
HasIpv4AddrIn returns a boolean if a field has been set.
|
||||
|
||||
### GetIncludeInCountry
|
||||
|
||||
`func (o *BridgeRelay) GetIncludeInCountry() bool`
|
||||
|
||||
GetIncludeInCountry returns the IncludeInCountry field if non-nil, zero value otherwise.
|
||||
|
||||
### GetIncludeInCountryOk
|
||||
|
||||
`func (o *BridgeRelay) GetIncludeInCountryOk() (*bool, bool)`
|
||||
|
||||
GetIncludeInCountryOk returns a tuple with the IncludeInCountry field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetIncludeInCountry
|
||||
|
||||
`func (o *BridgeRelay) SetIncludeInCountry(v bool)`
|
||||
|
||||
SetIncludeInCountry sets IncludeInCountry field to given value.
|
||||
|
||||
### HasIncludeInCountry
|
||||
|
||||
`func (o *BridgeRelay) HasIncludeInCountry() bool`
|
||||
|
||||
HasIncludeInCountry returns a boolean if a field has been set.
|
||||
|
||||
### GetWeight
|
||||
|
||||
`func (o *BridgeRelay) GetWeight() int32`
|
||||
|
||||
GetWeight returns the Weight field if non-nil, zero value otherwise.
|
||||
|
||||
### GetWeightOk
|
||||
|
||||
`func (o *BridgeRelay) GetWeightOk() (*int32, bool)`
|
||||
|
||||
GetWeightOk returns a tuple with the Weight field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetWeight
|
||||
|
||||
`func (o *BridgeRelay) SetWeight(v int32)`
|
||||
|
||||
SetWeight sets Weight field to given value.
|
||||
|
||||
### HasWeight
|
||||
|
||||
`func (o *BridgeRelay) HasWeight() bool`
|
||||
|
||||
HasWeight 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)
|
||||
|
||||
|
839
pkg/mullvad_api/docs/DefaultAPI.md
Normal file
839
pkg/mullvad_api/docs/DefaultAPI.md
Normal file
@ -0,0 +1,839 @@
|
||||
# \DefaultAPI
|
||||
|
||||
All URIs are relative to */app*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**V1AccountsPost**](DefaultAPI.md#V1AccountsPost) | **Post** /v1/accounts | Create account
|
||||
[**V1ApiAddrsGet**](DefaultAPI.md#V1ApiAddrsGet) | **Get** /v1/api-addrs | List IP addresses for reaching the API
|
||||
[**V1CreateApplePaymentPost**](DefaultAPI.md#V1CreateApplePaymentPost) | **Post** /v1/create-apple-payment | Create an Apple In-App payment
|
||||
[**V1MeGet**](DefaultAPI.md#V1MeGet) | **Get** /v1/me | Get info about account
|
||||
[**V1ProblemReportPost**](DefaultAPI.md#V1ProblemReportPost) | **Post** /v1/problem-report | Submit a problem report
|
||||
[**V1RelaysGet**](DefaultAPI.md#V1RelaysGet) | **Get** /v1/relays | Relay list
|
||||
[**V1ReleasesPlatformVersionGet**](DefaultAPI.md#V1ReleasesPlatformVersionGet) | **Get** /v1/releases/{platform}/{version} | Information about app release
|
||||
[**V1ReplaceWireguardKeyPost**](DefaultAPI.md#V1ReplaceWireguardKeyPost) | **Post** /v1/replace-wireguard-key | Replace a WireGuard pubkey
|
||||
[**V1SubmitVoucherPost**](DefaultAPI.md#V1SubmitVoucherPost) | **Post** /v1/submit-voucher | Submit a voucher
|
||||
[**V1WireguardKeysPost**](DefaultAPI.md#V1WireguardKeysPost) | **Post** /v1/wireguard-keys | Add WireGuard public key
|
||||
[**V1WireguardKeysPubkeyDelete**](DefaultAPI.md#V1WireguardKeysPubkeyDelete) | **Delete** /v1/wireguard-keys/{pubkey} | Delete WireGuard public key
|
||||
[**V1WireguardKeysPubkeyGet**](DefaultAPI.md#V1WireguardKeysPubkeyGet) | **Get** /v1/wireguard-keys/{pubkey} | Get WireGuard public key
|
||||
[**V1WwwAuthTokenPost**](DefaultAPI.md#V1WwwAuthTokenPost) | **Post** /v1/www-auth-token | Request a website auth token (valid for 1 hour)
|
||||
|
||||
|
||||
|
||||
## V1AccountsPost
|
||||
|
||||
> V1MeGet200Response V1AccountsPost(ctx).Execute()
|
||||
|
||||
Create account
|
||||
|
||||
### Example
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/mullvad_api"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
configuration := openapiclient.NewConfiguration()
|
||||
apiClient := openapiclient.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.DefaultAPI.V1AccountsPost(context.Background()).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.V1AccountsPost``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `V1AccountsPost`: V1MeGet200Response
|
||||
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.V1AccountsPost`: %v\n", resp)
|
||||
}
|
||||
```
|
||||
|
||||
### Path Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Other Parameters
|
||||
|
||||
Other parameters are passed through a pointer to a apiV1AccountsPostRequest struct via the builder pattern
|
||||
|
||||
|
||||
### Return type
|
||||
|
||||
[**V1MeGet200Response**](V1MeGet200Response.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)
|
||||
|
||||
|
||||
## V1ApiAddrsGet
|
||||
|
||||
> []string V1ApiAddrsGet(ctx).Execute()
|
||||
|
||||
List IP addresses for reaching the API
|
||||
|
||||
### Example
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/mullvad_api"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
configuration := openapiclient.NewConfiguration()
|
||||
apiClient := openapiclient.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.DefaultAPI.V1ApiAddrsGet(context.Background()).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.V1ApiAddrsGet``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `V1ApiAddrsGet`: []string
|
||||
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.V1ApiAddrsGet`: %v\n", resp)
|
||||
}
|
||||
```
|
||||
|
||||
### Path Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Other Parameters
|
||||
|
||||
Other parameters are passed through a pointer to a apiV1ApiAddrsGetRequest struct via the builder pattern
|
||||
|
||||
|
||||
### Return type
|
||||
|
||||
**[]string**
|
||||
|
||||
### 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)
|
||||
|
||||
|
||||
## V1CreateApplePaymentPost
|
||||
|
||||
> V1SubmitVoucherPost200Response V1CreateApplePaymentPost(ctx).V1CreateApplePaymentPostRequest(v1CreateApplePaymentPostRequest).Execute()
|
||||
|
||||
Create an Apple In-App payment
|
||||
|
||||
### Example
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/mullvad_api"
|
||||
)
|
||||
|
||||
func main() {
|
||||
v1CreateApplePaymentPostRequest := *openapiclient.NewV1CreateApplePaymentPostRequest("ReceiptString_example") // V1CreateApplePaymentPostRequest | (optional)
|
||||
|
||||
configuration := openapiclient.NewConfiguration()
|
||||
apiClient := openapiclient.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.DefaultAPI.V1CreateApplePaymentPost(context.Background()).V1CreateApplePaymentPostRequest(v1CreateApplePaymentPostRequest).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.V1CreateApplePaymentPost``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `V1CreateApplePaymentPost`: V1SubmitVoucherPost200Response
|
||||
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.V1CreateApplePaymentPost`: %v\n", resp)
|
||||
}
|
||||
```
|
||||
|
||||
### Path Parameters
|
||||
|
||||
|
||||
|
||||
### Other Parameters
|
||||
|
||||
Other parameters are passed through a pointer to a apiV1CreateApplePaymentPostRequest struct via the builder pattern
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**v1CreateApplePaymentPostRequest** | [**V1CreateApplePaymentPostRequest**](V1CreateApplePaymentPostRequest.md) | |
|
||||
|
||||
### Return type
|
||||
|
||||
[**V1SubmitVoucherPost200Response**](V1SubmitVoucherPost200Response.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[TokenAuth](../README.md#TokenAuth)
|
||||
|
||||
### 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)
|
||||
|
||||
|
||||
## V1MeGet
|
||||
|
||||
> V1MeGet200Response V1MeGet(ctx).Execute()
|
||||
|
||||
Get info about account
|
||||
|
||||
### Example
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/mullvad_api"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
configuration := openapiclient.NewConfiguration()
|
||||
apiClient := openapiclient.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.DefaultAPI.V1MeGet(context.Background()).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.V1MeGet``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `V1MeGet`: V1MeGet200Response
|
||||
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.V1MeGet`: %v\n", resp)
|
||||
}
|
||||
```
|
||||
|
||||
### Path Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Other Parameters
|
||||
|
||||
Other parameters are passed through a pointer to a apiV1MeGetRequest struct via the builder pattern
|
||||
|
||||
|
||||
### Return type
|
||||
|
||||
[**V1MeGet200Response**](V1MeGet200Response.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[AccessToken](../README.md#AccessToken), [TokenAuth](../README.md#TokenAuth)
|
||||
|
||||
### 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)
|
||||
|
||||
|
||||
## V1ProblemReportPost
|
||||
|
||||
> V1ProblemReportPost(ctx).V1ProblemReportPostRequest(v1ProblemReportPostRequest).Execute()
|
||||
|
||||
Submit a problem report
|
||||
|
||||
### Example
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/mullvad_api"
|
||||
)
|
||||
|
||||
func main() {
|
||||
v1ProblemReportPostRequest := *openapiclient.NewV1ProblemReportPostRequest("Log_example", map[string]interface{}(123)) // V1ProblemReportPostRequest | (optional)
|
||||
|
||||
configuration := openapiclient.NewConfiguration()
|
||||
apiClient := openapiclient.NewAPIClient(configuration)
|
||||
r, err := apiClient.DefaultAPI.V1ProblemReportPost(context.Background()).V1ProblemReportPostRequest(v1ProblemReportPostRequest).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.V1ProblemReportPost``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Path Parameters
|
||||
|
||||
|
||||
|
||||
### Other Parameters
|
||||
|
||||
Other parameters are passed through a pointer to a apiV1ProblemReportPostRequest struct via the builder pattern
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**v1ProblemReportPostRequest** | [**V1ProblemReportPostRequest**](V1ProblemReportPostRequest.md) | |
|
||||
|
||||
### Return type
|
||||
|
||||
(empty response body)
|
||||
|
||||
### 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)
|
||||
|
||||
|
||||
## V1RelaysGet
|
||||
|
||||
> V1RelaysGet200Response V1RelaysGet(ctx).Execute()
|
||||
|
||||
Relay list
|
||||
|
||||
### Example
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/mullvad_api"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
configuration := openapiclient.NewConfiguration()
|
||||
apiClient := openapiclient.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.DefaultAPI.V1RelaysGet(context.Background()).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.V1RelaysGet``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `V1RelaysGet`: V1RelaysGet200Response
|
||||
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.V1RelaysGet`: %v\n", resp)
|
||||
}
|
||||
```
|
||||
|
||||
### Path Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Other Parameters
|
||||
|
||||
Other parameters are passed through a pointer to a apiV1RelaysGetRequest struct via the builder pattern
|
||||
|
||||
|
||||
### Return type
|
||||
|
||||
[**V1RelaysGet200Response**](V1RelaysGet200Response.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)
|
||||
|
||||
|
||||
## V1ReleasesPlatformVersionGet
|
||||
|
||||
> V1ReleasesPlatformVersionGet200Response V1ReleasesPlatformVersionGet(ctx, platform, version).Execute()
|
||||
|
||||
Information about app release
|
||||
|
||||
### Example
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/mullvad_api"
|
||||
)
|
||||
|
||||
func main() {
|
||||
platform := "platform_example" // string |
|
||||
version := "version_example" // string |
|
||||
|
||||
configuration := openapiclient.NewConfiguration()
|
||||
apiClient := openapiclient.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.DefaultAPI.V1ReleasesPlatformVersionGet(context.Background(), platform, version).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.V1ReleasesPlatformVersionGet``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `V1ReleasesPlatformVersionGet`: V1ReleasesPlatformVersionGet200Response
|
||||
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.V1ReleasesPlatformVersionGet`: %v\n", resp)
|
||||
}
|
||||
```
|
||||
|
||||
### Path Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||
**platform** | **string** | |
|
||||
**version** | **string** | |
|
||||
|
||||
### Other Parameters
|
||||
|
||||
Other parameters are passed through a pointer to a apiV1ReleasesPlatformVersionGetRequest struct via the builder pattern
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
|
||||
|
||||
|
||||
### Return type
|
||||
|
||||
[**V1ReleasesPlatformVersionGet200Response**](V1ReleasesPlatformVersionGet200Response.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)
|
||||
|
||||
|
||||
## V1ReplaceWireguardKeyPost
|
||||
|
||||
> WireGuardPubkey V1ReplaceWireguardKeyPost(ctx).V1ReplaceWireguardKeyPostRequest(v1ReplaceWireguardKeyPostRequest).Execute()
|
||||
|
||||
Replace a WireGuard pubkey
|
||||
|
||||
### Example
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/mullvad_api"
|
||||
)
|
||||
|
||||
func main() {
|
||||
v1ReplaceWireguardKeyPostRequest := *openapiclient.NewV1ReplaceWireguardKeyPostRequest("Old_example", "New_example") // V1ReplaceWireguardKeyPostRequest | (optional)
|
||||
|
||||
configuration := openapiclient.NewConfiguration()
|
||||
apiClient := openapiclient.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.DefaultAPI.V1ReplaceWireguardKeyPost(context.Background()).V1ReplaceWireguardKeyPostRequest(v1ReplaceWireguardKeyPostRequest).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.V1ReplaceWireguardKeyPost``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `V1ReplaceWireguardKeyPost`: WireGuardPubkey
|
||||
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.V1ReplaceWireguardKeyPost`: %v\n", resp)
|
||||
}
|
||||
```
|
||||
|
||||
### Path Parameters
|
||||
|
||||
|
||||
|
||||
### Other Parameters
|
||||
|
||||
Other parameters are passed through a pointer to a apiV1ReplaceWireguardKeyPostRequest struct via the builder pattern
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**v1ReplaceWireguardKeyPostRequest** | [**V1ReplaceWireguardKeyPostRequest**](V1ReplaceWireguardKeyPostRequest.md) | |
|
||||
|
||||
### Return type
|
||||
|
||||
[**WireGuardPubkey**](WireGuardPubkey.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[TokenAuth](../README.md#TokenAuth)
|
||||
|
||||
### 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)
|
||||
|
||||
|
||||
## V1SubmitVoucherPost
|
||||
|
||||
> V1SubmitVoucherPost200Response V1SubmitVoucherPost(ctx).V1SubmitVoucherPostRequest(v1SubmitVoucherPostRequest).Execute()
|
||||
|
||||
Submit a voucher
|
||||
|
||||
### Example
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/mullvad_api"
|
||||
)
|
||||
|
||||
func main() {
|
||||
v1SubmitVoucherPostRequest := *openapiclient.NewV1SubmitVoucherPostRequest("VoucherCode_example") // V1SubmitVoucherPostRequest | (optional)
|
||||
|
||||
configuration := openapiclient.NewConfiguration()
|
||||
apiClient := openapiclient.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.DefaultAPI.V1SubmitVoucherPost(context.Background()).V1SubmitVoucherPostRequest(v1SubmitVoucherPostRequest).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.V1SubmitVoucherPost``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `V1SubmitVoucherPost`: V1SubmitVoucherPost200Response
|
||||
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.V1SubmitVoucherPost`: %v\n", resp)
|
||||
}
|
||||
```
|
||||
|
||||
### Path Parameters
|
||||
|
||||
|
||||
|
||||
### Other Parameters
|
||||
|
||||
Other parameters are passed through a pointer to a apiV1SubmitVoucherPostRequest struct via the builder pattern
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**v1SubmitVoucherPostRequest** | [**V1SubmitVoucherPostRequest**](V1SubmitVoucherPostRequest.md) | |
|
||||
|
||||
### Return type
|
||||
|
||||
[**V1SubmitVoucherPost200Response**](V1SubmitVoucherPost200Response.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[TokenAuth](../README.md#TokenAuth)
|
||||
|
||||
### 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)
|
||||
|
||||
|
||||
## V1WireguardKeysPost
|
||||
|
||||
> WireGuardPubkey V1WireguardKeysPost(ctx).V1WireguardKeysPostRequest(v1WireguardKeysPostRequest).Execute()
|
||||
|
||||
Add WireGuard public key
|
||||
|
||||
### Example
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/mullvad_api"
|
||||
)
|
||||
|
||||
func main() {
|
||||
v1WireguardKeysPostRequest := *openapiclient.NewV1WireguardKeysPostRequest("Pubkey_example") // V1WireguardKeysPostRequest | (optional)
|
||||
|
||||
configuration := openapiclient.NewConfiguration()
|
||||
apiClient := openapiclient.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.DefaultAPI.V1WireguardKeysPost(context.Background()).V1WireguardKeysPostRequest(v1WireguardKeysPostRequest).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.V1WireguardKeysPost``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `V1WireguardKeysPost`: WireGuardPubkey
|
||||
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.V1WireguardKeysPost`: %v\n", resp)
|
||||
}
|
||||
```
|
||||
|
||||
### Path Parameters
|
||||
|
||||
|
||||
|
||||
### Other Parameters
|
||||
|
||||
Other parameters are passed through a pointer to a apiV1WireguardKeysPostRequest struct via the builder pattern
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**v1WireguardKeysPostRequest** | [**V1WireguardKeysPostRequest**](V1WireguardKeysPostRequest.md) | |
|
||||
|
||||
### Return type
|
||||
|
||||
[**WireGuardPubkey**](WireGuardPubkey.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[TokenAuth](../README.md#TokenAuth)
|
||||
|
||||
### 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)
|
||||
|
||||
|
||||
## V1WireguardKeysPubkeyDelete
|
||||
|
||||
> V1WireguardKeysPubkeyDelete(ctx, pubkey).Execute()
|
||||
|
||||
Delete WireGuard public key
|
||||
|
||||
### Example
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/mullvad_api"
|
||||
)
|
||||
|
||||
func main() {
|
||||
pubkey := "pubkey_example" // string | The WireGuard public key, urlencoded.
|
||||
|
||||
configuration := openapiclient.NewConfiguration()
|
||||
apiClient := openapiclient.NewAPIClient(configuration)
|
||||
r, err := apiClient.DefaultAPI.V1WireguardKeysPubkeyDelete(context.Background(), pubkey).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.V1WireguardKeysPubkeyDelete``: %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.
|
||||
**pubkey** | **string** | The WireGuard public key, urlencoded. |
|
||||
|
||||
### Other Parameters
|
||||
|
||||
Other parameters are passed through a pointer to a apiV1WireguardKeysPubkeyDeleteRequest struct via the builder pattern
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
|
||||
|
||||
### Return type
|
||||
|
||||
(empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[TokenAuth](../README.md#TokenAuth)
|
||||
|
||||
### 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)
|
||||
|
||||
|
||||
## V1WireguardKeysPubkeyGet
|
||||
|
||||
> WireGuardPubkey V1WireguardKeysPubkeyGet(ctx, pubkey).Execute()
|
||||
|
||||
Get WireGuard public key
|
||||
|
||||
### Example
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/mullvad_api"
|
||||
)
|
||||
|
||||
func main() {
|
||||
pubkey := "pubkey_example" // string | The WireGuard public key, urlencoded.
|
||||
|
||||
configuration := openapiclient.NewConfiguration()
|
||||
apiClient := openapiclient.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.DefaultAPI.V1WireguardKeysPubkeyGet(context.Background(), pubkey).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.V1WireguardKeysPubkeyGet``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `V1WireguardKeysPubkeyGet`: WireGuardPubkey
|
||||
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.V1WireguardKeysPubkeyGet`: %v\n", resp)
|
||||
}
|
||||
```
|
||||
|
||||
### Path Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||
**pubkey** | **string** | The WireGuard public key, urlencoded. |
|
||||
|
||||
### Other Parameters
|
||||
|
||||
Other parameters are passed through a pointer to a apiV1WireguardKeysPubkeyGetRequest struct via the builder pattern
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
|
||||
|
||||
### Return type
|
||||
|
||||
[**WireGuardPubkey**](WireGuardPubkey.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[TokenAuth](../README.md#TokenAuth)
|
||||
|
||||
### 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)
|
||||
|
||||
|
||||
## V1WwwAuthTokenPost
|
||||
|
||||
> V1WwwAuthTokenPost200Response V1WwwAuthTokenPost(ctx).Execute()
|
||||
|
||||
Request a website auth token (valid for 1 hour)
|
||||
|
||||
### Example
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/mullvad_api"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
configuration := openapiclient.NewConfiguration()
|
||||
apiClient := openapiclient.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.DefaultAPI.V1WwwAuthTokenPost(context.Background()).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.V1WwwAuthTokenPost``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `V1WwwAuthTokenPost`: V1WwwAuthTokenPost200Response
|
||||
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.V1WwwAuthTokenPost`: %v\n", resp)
|
||||
}
|
||||
```
|
||||
|
||||
### Path Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Other Parameters
|
||||
|
||||
Other parameters are passed through a pointer to a apiV1WwwAuthTokenPostRequest struct via the builder pattern
|
||||
|
||||
|
||||
### Return type
|
||||
|
||||
[**V1WwwAuthTokenPost200Response**](V1WwwAuthTokenPost200Response.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[TokenAuth](../README.md#TokenAuth)
|
||||
|
||||
### 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)
|
||||
|
82
pkg/mullvad_api/docs/ErrorSchema.md
Normal file
82
pkg/mullvad_api/docs/ErrorSchema.md
Normal file
@ -0,0 +1,82 @@
|
||||
# ErrorSchema
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Code** | Pointer to **string** | The error code. | [optional]
|
||||
**Error** | Pointer to **string** | The error message. | [optional]
|
||||
|
||||
## Methods
|
||||
|
||||
### NewErrorSchema
|
||||
|
||||
`func NewErrorSchema() *ErrorSchema`
|
||||
|
||||
NewErrorSchema instantiates a new ErrorSchema 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
|
||||
|
||||
### NewErrorSchemaWithDefaults
|
||||
|
||||
`func NewErrorSchemaWithDefaults() *ErrorSchema`
|
||||
|
||||
NewErrorSchemaWithDefaults instantiates a new ErrorSchema 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
|
||||
|
||||
### GetCode
|
||||
|
||||
`func (o *ErrorSchema) GetCode() string`
|
||||
|
||||
GetCode returns the Code field if non-nil, zero value otherwise.
|
||||
|
||||
### GetCodeOk
|
||||
|
||||
`func (o *ErrorSchema) GetCodeOk() (*string, bool)`
|
||||
|
||||
GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetCode
|
||||
|
||||
`func (o *ErrorSchema) SetCode(v string)`
|
||||
|
||||
SetCode sets Code field to given value.
|
||||
|
||||
### HasCode
|
||||
|
||||
`func (o *ErrorSchema) HasCode() bool`
|
||||
|
||||
HasCode returns a boolean if a field has been set.
|
||||
|
||||
### GetError
|
||||
|
||||
`func (o *ErrorSchema) GetError() string`
|
||||
|
||||
GetError returns the Error field if non-nil, zero value otherwise.
|
||||
|
||||
### GetErrorOk
|
||||
|
||||
`func (o *ErrorSchema) GetErrorOk() (*string, bool)`
|
||||
|
||||
GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetError
|
||||
|
||||
`func (o *ErrorSchema) SetError(v string)`
|
||||
|
||||
SetError sets Error field to given value.
|
||||
|
||||
### HasError
|
||||
|
||||
`func (o *ErrorSchema) HasError() bool`
|
||||
|
||||
HasError 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)
|
||||
|
||||
|
134
pkg/mullvad_api/docs/Location.md
Normal file
134
pkg/mullvad_api/docs/Location.md
Normal file
@ -0,0 +1,134 @@
|
||||
# Location
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**City** | Pointer to **string** | | [optional]
|
||||
**Country** | Pointer to **string** | | [optional]
|
||||
**Latitude** | Pointer to **float32** | | [optional]
|
||||
**Longitude** | Pointer to **float32** | | [optional]
|
||||
|
||||
## Methods
|
||||
|
||||
### NewLocation
|
||||
|
||||
`func NewLocation() *Location`
|
||||
|
||||
NewLocation instantiates a new Location 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
|
||||
|
||||
### NewLocationWithDefaults
|
||||
|
||||
`func NewLocationWithDefaults() *Location`
|
||||
|
||||
NewLocationWithDefaults instantiates a new Location 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
|
||||
|
||||
### GetCity
|
||||
|
||||
`func (o *Location) GetCity() string`
|
||||
|
||||
GetCity returns the City field if non-nil, zero value otherwise.
|
||||
|
||||
### GetCityOk
|
||||
|
||||
`func (o *Location) GetCityOk() (*string, bool)`
|
||||
|
||||
GetCityOk returns a tuple with the City field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetCity
|
||||
|
||||
`func (o *Location) SetCity(v string)`
|
||||
|
||||
SetCity sets City field to given value.
|
||||
|
||||
### HasCity
|
||||
|
||||
`func (o *Location) HasCity() bool`
|
||||
|
||||
HasCity returns a boolean if a field has been set.
|
||||
|
||||
### GetCountry
|
||||
|
||||
`func (o *Location) GetCountry() string`
|
||||
|
||||
GetCountry returns the Country field if non-nil, zero value otherwise.
|
||||
|
||||
### GetCountryOk
|
||||
|
||||
`func (o *Location) GetCountryOk() (*string, bool)`
|
||||
|
||||
GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetCountry
|
||||
|
||||
`func (o *Location) SetCountry(v string)`
|
||||
|
||||
SetCountry sets Country field to given value.
|
||||
|
||||
### HasCountry
|
||||
|
||||
`func (o *Location) HasCountry() bool`
|
||||
|
||||
HasCountry returns a boolean if a field has been set.
|
||||
|
||||
### GetLatitude
|
||||
|
||||
`func (o *Location) GetLatitude() float32`
|
||||
|
||||
GetLatitude returns the Latitude field if non-nil, zero value otherwise.
|
||||
|
||||
### GetLatitudeOk
|
||||
|
||||
`func (o *Location) GetLatitudeOk() (*float32, bool)`
|
||||
|
||||
GetLatitudeOk returns a tuple with the Latitude field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetLatitude
|
||||
|
||||
`func (o *Location) SetLatitude(v float32)`
|
||||
|
||||
SetLatitude sets Latitude field to given value.
|
||||
|
||||
### HasLatitude
|
||||
|
||||
`func (o *Location) HasLatitude() bool`
|
||||
|
||||
HasLatitude returns a boolean if a field has been set.
|
||||
|
||||
### GetLongitude
|
||||
|
||||
`func (o *Location) GetLongitude() float32`
|
||||
|
||||
GetLongitude returns the Longitude field if non-nil, zero value otherwise.
|
||||
|
||||
### GetLongitudeOk
|
||||
|
||||
`func (o *Location) GetLongitudeOk() (*float32, bool)`
|
||||
|
||||
GetLongitudeOk returns a tuple with the Longitude field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetLongitude
|
||||
|
||||
`func (o *Location) SetLongitude(v float32)`
|
||||
|
||||
SetLongitude sets Longitude field to given value.
|
||||
|
||||
### HasLongitude
|
||||
|
||||
`func (o *Location) HasLongitude() bool`
|
||||
|
||||
HasLongitude 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)
|
||||
|
||||
|
238
pkg/mullvad_api/docs/OpenVpnRelay.md
Normal file
238
pkg/mullvad_api/docs/OpenVpnRelay.md
Normal file
@ -0,0 +1,238 @@
|
||||
# OpenVpnRelay
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Hostname** | Pointer to **string** | | [optional]
|
||||
**Location** | Pointer to **string** | | [optional]
|
||||
**Active** | Pointer to **bool** | | [optional]
|
||||
**Owned** | Pointer to **bool** | | [optional]
|
||||
**Provider** | Pointer to **string** | | [optional]
|
||||
**Ipv4AddrIn** | Pointer to **string** | | [optional]
|
||||
**IncludeInCountry** | Pointer to **bool** | | [optional]
|
||||
**Weight** | Pointer to **int32** | | [optional]
|
||||
|
||||
## Methods
|
||||
|
||||
### NewOpenVpnRelay
|
||||
|
||||
`func NewOpenVpnRelay() *OpenVpnRelay`
|
||||
|
||||
NewOpenVpnRelay instantiates a new OpenVpnRelay 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
|
||||
|
||||
### NewOpenVpnRelayWithDefaults
|
||||
|
||||
`func NewOpenVpnRelayWithDefaults() *OpenVpnRelay`
|
||||
|
||||
NewOpenVpnRelayWithDefaults instantiates a new OpenVpnRelay 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
|
||||
|
||||
### GetHostname
|
||||
|
||||
`func (o *OpenVpnRelay) GetHostname() string`
|
||||
|
||||
GetHostname returns the Hostname field if non-nil, zero value otherwise.
|
||||
|
||||
### GetHostnameOk
|
||||
|
||||
`func (o *OpenVpnRelay) GetHostnameOk() (*string, bool)`
|
||||
|
||||
GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetHostname
|
||||
|
||||
`func (o *OpenVpnRelay) SetHostname(v string)`
|
||||
|
||||
SetHostname sets Hostname field to given value.
|
||||
|
||||
### HasHostname
|
||||
|
||||
`func (o *OpenVpnRelay) HasHostname() bool`
|
||||
|
||||
HasHostname returns a boolean if a field has been set.
|
||||
|
||||
### GetLocation
|
||||
|
||||
`func (o *OpenVpnRelay) GetLocation() string`
|
||||
|
||||
GetLocation returns the Location field if non-nil, zero value otherwise.
|
||||
|
||||
### GetLocationOk
|
||||
|
||||
`func (o *OpenVpnRelay) GetLocationOk() (*string, bool)`
|
||||
|
||||
GetLocationOk returns a tuple with the Location field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetLocation
|
||||
|
||||
`func (o *OpenVpnRelay) SetLocation(v string)`
|
||||
|
||||
SetLocation sets Location field to given value.
|
||||
|
||||
### HasLocation
|
||||
|
||||
`func (o *OpenVpnRelay) HasLocation() bool`
|
||||
|
||||
HasLocation returns a boolean if a field has been set.
|
||||
|
||||
### GetActive
|
||||
|
||||
`func (o *OpenVpnRelay) GetActive() bool`
|
||||
|
||||
GetActive returns the Active field if non-nil, zero value otherwise.
|
||||
|
||||
### GetActiveOk
|
||||
|
||||
`func (o *OpenVpnRelay) 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 *OpenVpnRelay) SetActive(v bool)`
|
||||
|
||||
SetActive sets Active field to given value.
|
||||
|
||||
### HasActive
|
||||
|
||||
`func (o *OpenVpnRelay) HasActive() bool`
|
||||
|
||||
HasActive returns a boolean if a field has been set.
|
||||
|
||||
### GetOwned
|
||||
|
||||
`func (o *OpenVpnRelay) GetOwned() bool`
|
||||
|
||||
GetOwned returns the Owned field if non-nil, zero value otherwise.
|
||||
|
||||
### GetOwnedOk
|
||||
|
||||
`func (o *OpenVpnRelay) GetOwnedOk() (*bool, bool)`
|
||||
|
||||
GetOwnedOk returns a tuple with the Owned field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetOwned
|
||||
|
||||
`func (o *OpenVpnRelay) SetOwned(v bool)`
|
||||
|
||||
SetOwned sets Owned field to given value.
|
||||
|
||||
### HasOwned
|
||||
|
||||
`func (o *OpenVpnRelay) HasOwned() bool`
|
||||
|
||||
HasOwned returns a boolean if a field has been set.
|
||||
|
||||
### GetProvider
|
||||
|
||||
`func (o *OpenVpnRelay) GetProvider() string`
|
||||
|
||||
GetProvider returns the Provider field if non-nil, zero value otherwise.
|
||||
|
||||
### GetProviderOk
|
||||
|
||||
`func (o *OpenVpnRelay) GetProviderOk() (*string, bool)`
|
||||
|
||||
GetProviderOk returns a tuple with the Provider field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetProvider
|
||||
|
||||
`func (o *OpenVpnRelay) SetProvider(v string)`
|
||||
|
||||
SetProvider sets Provider field to given value.
|
||||
|
||||
### HasProvider
|
||||
|
||||
`func (o *OpenVpnRelay) HasProvider() bool`
|
||||
|
||||
HasProvider returns a boolean if a field has been set.
|
||||
|
||||
### GetIpv4AddrIn
|
||||
|
||||
`func (o *OpenVpnRelay) GetIpv4AddrIn() string`
|
||||
|
||||
GetIpv4AddrIn returns the Ipv4AddrIn field if non-nil, zero value otherwise.
|
||||
|
||||
### GetIpv4AddrInOk
|
||||
|
||||
`func (o *OpenVpnRelay) GetIpv4AddrInOk() (*string, bool)`
|
||||
|
||||
GetIpv4AddrInOk returns a tuple with the Ipv4AddrIn field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetIpv4AddrIn
|
||||
|
||||
`func (o *OpenVpnRelay) SetIpv4AddrIn(v string)`
|
||||
|
||||
SetIpv4AddrIn sets Ipv4AddrIn field to given value.
|
||||
|
||||
### HasIpv4AddrIn
|
||||
|
||||
`func (o *OpenVpnRelay) HasIpv4AddrIn() bool`
|
||||
|
||||
HasIpv4AddrIn returns a boolean if a field has been set.
|
||||
|
||||
### GetIncludeInCountry
|
||||
|
||||
`func (o *OpenVpnRelay) GetIncludeInCountry() bool`
|
||||
|
||||
GetIncludeInCountry returns the IncludeInCountry field if non-nil, zero value otherwise.
|
||||
|
||||
### GetIncludeInCountryOk
|
||||
|
||||
`func (o *OpenVpnRelay) GetIncludeInCountryOk() (*bool, bool)`
|
||||
|
||||
GetIncludeInCountryOk returns a tuple with the IncludeInCountry field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetIncludeInCountry
|
||||
|
||||
`func (o *OpenVpnRelay) SetIncludeInCountry(v bool)`
|
||||
|
||||
SetIncludeInCountry sets IncludeInCountry field to given value.
|
||||
|
||||
### HasIncludeInCountry
|
||||
|
||||
`func (o *OpenVpnRelay) HasIncludeInCountry() bool`
|
||||
|
||||
HasIncludeInCountry returns a boolean if a field has been set.
|
||||
|
||||
### GetWeight
|
||||
|
||||
`func (o *OpenVpnRelay) GetWeight() int32`
|
||||
|
||||
GetWeight returns the Weight field if non-nil, zero value otherwise.
|
||||
|
||||
### GetWeightOk
|
||||
|
||||
`func (o *OpenVpnRelay) GetWeightOk() (*int32, bool)`
|
||||
|
||||
GetWeightOk returns a tuple with the Weight field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetWeight
|
||||
|
||||
`func (o *OpenVpnRelay) SetWeight(v int32)`
|
||||
|
||||
SetWeight sets Weight field to given value.
|
||||
|
||||
### HasWeight
|
||||
|
||||
`func (o *OpenVpnRelay) HasWeight() bool`
|
||||
|
||||
HasWeight 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)
|
||||
|
||||
|
238
pkg/mullvad_api/docs/Relay.md
Normal file
238
pkg/mullvad_api/docs/Relay.md
Normal file
@ -0,0 +1,238 @@
|
||||
# Relay
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Hostname** | Pointer to **string** | | [optional]
|
||||
**Location** | Pointer to **string** | | [optional]
|
||||
**Active** | Pointer to **bool** | | [optional]
|
||||
**Owned** | Pointer to **bool** | | [optional]
|
||||
**Provider** | Pointer to **string** | | [optional]
|
||||
**Ipv4AddrIn** | Pointer to **string** | | [optional]
|
||||
**IncludeInCountry** | Pointer to **bool** | | [optional]
|
||||
**Weight** | Pointer to **int32** | | [optional]
|
||||
|
||||
## Methods
|
||||
|
||||
### NewRelay
|
||||
|
||||
`func NewRelay() *Relay`
|
||||
|
||||
NewRelay instantiates a new Relay 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
|
||||
|
||||
### NewRelayWithDefaults
|
||||
|
||||
`func NewRelayWithDefaults() *Relay`
|
||||
|
||||
NewRelayWithDefaults instantiates a new Relay 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
|
||||
|
||||
### GetHostname
|
||||
|
||||
`func (o *Relay) GetHostname() string`
|
||||
|
||||
GetHostname returns the Hostname field if non-nil, zero value otherwise.
|
||||
|
||||
### GetHostnameOk
|
||||
|
||||
`func (o *Relay) GetHostnameOk() (*string, bool)`
|
||||
|
||||
GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetHostname
|
||||
|
||||
`func (o *Relay) SetHostname(v string)`
|
||||
|
||||
SetHostname sets Hostname field to given value.
|
||||
|
||||
### HasHostname
|
||||
|
||||
`func (o *Relay) HasHostname() bool`
|
||||
|
||||
HasHostname returns a boolean if a field has been set.
|
||||
|
||||
### GetLocation
|
||||
|
||||
`func (o *Relay) GetLocation() string`
|
||||
|
||||
GetLocation returns the Location field if non-nil, zero value otherwise.
|
||||
|
||||
### GetLocationOk
|
||||
|
||||
`func (o *Relay) GetLocationOk() (*string, bool)`
|
||||
|
||||
GetLocationOk returns a tuple with the Location field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetLocation
|
||||
|
||||
`func (o *Relay) SetLocation(v string)`
|
||||
|
||||
SetLocation sets Location field to given value.
|
||||
|
||||
### HasLocation
|
||||
|
||||
`func (o *Relay) HasLocation() bool`
|
||||
|
||||
HasLocation returns a boolean if a field has been set.
|
||||
|
||||
### GetActive
|
||||
|
||||
`func (o *Relay) GetActive() bool`
|
||||
|
||||
GetActive returns the Active field if non-nil, zero value otherwise.
|
||||
|
||||
### GetActiveOk
|
||||
|
||||
`func (o *Relay) 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 *Relay) SetActive(v bool)`
|
||||
|
||||
SetActive sets Active field to given value.
|
||||
|
||||
### HasActive
|
||||
|
||||
`func (o *Relay) HasActive() bool`
|
||||
|
||||
HasActive returns a boolean if a field has been set.
|
||||
|
||||
### GetOwned
|
||||
|
||||
`func (o *Relay) GetOwned() bool`
|
||||
|
||||
GetOwned returns the Owned field if non-nil, zero value otherwise.
|
||||
|
||||
### GetOwnedOk
|
||||
|
||||
`func (o *Relay) GetOwnedOk() (*bool, bool)`
|
||||
|
||||
GetOwnedOk returns a tuple with the Owned field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetOwned
|
||||
|
||||
`func (o *Relay) SetOwned(v bool)`
|
||||
|
||||
SetOwned sets Owned field to given value.
|
||||
|
||||
### HasOwned
|
||||
|
||||
`func (o *Relay) HasOwned() bool`
|
||||
|
||||
HasOwned returns a boolean if a field has been set.
|
||||
|
||||
### GetProvider
|
||||
|
||||
`func (o *Relay) GetProvider() string`
|
||||
|
||||
GetProvider returns the Provider field if non-nil, zero value otherwise.
|
||||
|
||||
### GetProviderOk
|
||||
|
||||
`func (o *Relay) GetProviderOk() (*string, bool)`
|
||||
|
||||
GetProviderOk returns a tuple with the Provider field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetProvider
|
||||
|
||||
`func (o *Relay) SetProvider(v string)`
|
||||
|
||||
SetProvider sets Provider field to given value.
|
||||
|
||||
### HasProvider
|
||||
|
||||
`func (o *Relay) HasProvider() bool`
|
||||
|
||||
HasProvider returns a boolean if a field has been set.
|
||||
|
||||
### GetIpv4AddrIn
|
||||
|
||||
`func (o *Relay) GetIpv4AddrIn() string`
|
||||
|
||||
GetIpv4AddrIn returns the Ipv4AddrIn field if non-nil, zero value otherwise.
|
||||
|
||||
### GetIpv4AddrInOk
|
||||
|
||||
`func (o *Relay) GetIpv4AddrInOk() (*string, bool)`
|
||||
|
||||
GetIpv4AddrInOk returns a tuple with the Ipv4AddrIn field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetIpv4AddrIn
|
||||
|
||||
`func (o *Relay) SetIpv4AddrIn(v string)`
|
||||
|
||||
SetIpv4AddrIn sets Ipv4AddrIn field to given value.
|
||||
|
||||
### HasIpv4AddrIn
|
||||
|
||||
`func (o *Relay) HasIpv4AddrIn() bool`
|
||||
|
||||
HasIpv4AddrIn returns a boolean if a field has been set.
|
||||
|
||||
### GetIncludeInCountry
|
||||
|
||||
`func (o *Relay) GetIncludeInCountry() bool`
|
||||
|
||||
GetIncludeInCountry returns the IncludeInCountry field if non-nil, zero value otherwise.
|
||||
|
||||
### GetIncludeInCountryOk
|
||||
|
||||
`func (o *Relay) GetIncludeInCountryOk() (*bool, bool)`
|
||||
|
||||
GetIncludeInCountryOk returns a tuple with the IncludeInCountry field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetIncludeInCountry
|
||||
|
||||
`func (o *Relay) SetIncludeInCountry(v bool)`
|
||||
|
||||
SetIncludeInCountry sets IncludeInCountry field to given value.
|
||||
|
||||
### HasIncludeInCountry
|
||||
|
||||
`func (o *Relay) HasIncludeInCountry() bool`
|
||||
|
||||
HasIncludeInCountry returns a boolean if a field has been set.
|
||||
|
||||
### GetWeight
|
||||
|
||||
`func (o *Relay) GetWeight() int32`
|
||||
|
||||
GetWeight returns the Weight field if non-nil, zero value otherwise.
|
||||
|
||||
### GetWeightOk
|
||||
|
||||
`func (o *Relay) GetWeightOk() (*int32, bool)`
|
||||
|
||||
GetWeightOk returns a tuple with the Weight field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetWeight
|
||||
|
||||
`func (o *Relay) SetWeight(v int32)`
|
||||
|
||||
SetWeight sets Weight field to given value.
|
||||
|
||||
### HasWeight
|
||||
|
||||
`func (o *Relay) HasWeight() bool`
|
||||
|
||||
HasWeight 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)
|
||||
|
||||
|
51
pkg/mullvad_api/docs/V1CreateApplePaymentPostRequest.md
Normal file
51
pkg/mullvad_api/docs/V1CreateApplePaymentPostRequest.md
Normal file
@ -0,0 +1,51 @@
|
||||
# V1CreateApplePaymentPostRequest
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ReceiptString** | **string** | An encrypted Base64-encoded App Store receipt |
|
||||
|
||||
## Methods
|
||||
|
||||
### NewV1CreateApplePaymentPostRequest
|
||||
|
||||
`func NewV1CreateApplePaymentPostRequest(receiptString string, ) *V1CreateApplePaymentPostRequest`
|
||||
|
||||
NewV1CreateApplePaymentPostRequest instantiates a new V1CreateApplePaymentPostRequest 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
|
||||
|
||||
### NewV1CreateApplePaymentPostRequestWithDefaults
|
||||
|
||||
`func NewV1CreateApplePaymentPostRequestWithDefaults() *V1CreateApplePaymentPostRequest`
|
||||
|
||||
NewV1CreateApplePaymentPostRequestWithDefaults instantiates a new V1CreateApplePaymentPostRequest 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
|
||||
|
||||
### GetReceiptString
|
||||
|
||||
`func (o *V1CreateApplePaymentPostRequest) GetReceiptString() string`
|
||||
|
||||
GetReceiptString returns the ReceiptString field if non-nil, zero value otherwise.
|
||||
|
||||
### GetReceiptStringOk
|
||||
|
||||
`func (o *V1CreateApplePaymentPostRequest) GetReceiptStringOk() (*string, bool)`
|
||||
|
||||
GetReceiptStringOk returns a tuple with the ReceiptString field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetReceiptString
|
||||
|
||||
`func (o *V1CreateApplePaymentPostRequest) SetReceiptString(v string)`
|
||||
|
||||
SetReceiptString sets ReceiptString 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)
|
||||
|
||||
|
82
pkg/mullvad_api/docs/V1MeGet200Response.md
Normal file
82
pkg/mullvad_api/docs/V1MeGet200Response.md
Normal file
@ -0,0 +1,82 @@
|
||||
# V1MeGet200Response
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Token** | Pointer to **string** | | [optional]
|
||||
**Expires** | Pointer to **string** | | [optional]
|
||||
|
||||
## Methods
|
||||
|
||||
### NewV1MeGet200Response
|
||||
|
||||
`func NewV1MeGet200Response() *V1MeGet200Response`
|
||||
|
||||
NewV1MeGet200Response instantiates a new V1MeGet200Response 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
|
||||
|
||||
### NewV1MeGet200ResponseWithDefaults
|
||||
|
||||
`func NewV1MeGet200ResponseWithDefaults() *V1MeGet200Response`
|
||||
|
||||
NewV1MeGet200ResponseWithDefaults instantiates a new V1MeGet200Response 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
|
||||
|
||||
### GetToken
|
||||
|
||||
`func (o *V1MeGet200Response) GetToken() string`
|
||||
|
||||
GetToken returns the Token field if non-nil, zero value otherwise.
|
||||
|
||||
### GetTokenOk
|
||||
|
||||
`func (o *V1MeGet200Response) 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 *V1MeGet200Response) SetToken(v string)`
|
||||
|
||||
SetToken sets Token field to given value.
|
||||
|
||||
### HasToken
|
||||
|
||||
`func (o *V1MeGet200Response) HasToken() bool`
|
||||
|
||||
HasToken returns a boolean if a field has been set.
|
||||
|
||||
### GetExpires
|
||||
|
||||
`func (o *V1MeGet200Response) GetExpires() string`
|
||||
|
||||
GetExpires returns the Expires field if non-nil, zero value otherwise.
|
||||
|
||||
### GetExpiresOk
|
||||
|
||||
`func (o *V1MeGet200Response) GetExpiresOk() (*string, bool)`
|
||||
|
||||
GetExpiresOk returns a tuple with the Expires field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetExpires
|
||||
|
||||
`func (o *V1MeGet200Response) SetExpires(v string)`
|
||||
|
||||
SetExpires sets Expires field to given value.
|
||||
|
||||
### HasExpires
|
||||
|
||||
`func (o *V1MeGet200Response) HasExpires() bool`
|
||||
|
||||
HasExpires 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)
|
||||
|
||||
|
124
pkg/mullvad_api/docs/V1ProblemReportPostRequest.md
Normal file
124
pkg/mullvad_api/docs/V1ProblemReportPostRequest.md
Normal file
@ -0,0 +1,124 @@
|
||||
# V1ProblemReportPostRequest
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Address** | Pointer to **string** | | [optional]
|
||||
**Message** | Pointer to **string** | | [optional]
|
||||
**Log** | **string** | |
|
||||
**Metadata** | **map[string]interface{}** | |
|
||||
|
||||
## Methods
|
||||
|
||||
### NewV1ProblemReportPostRequest
|
||||
|
||||
`func NewV1ProblemReportPostRequest(log string, metadata map[string]interface{}, ) *V1ProblemReportPostRequest`
|
||||
|
||||
NewV1ProblemReportPostRequest instantiates a new V1ProblemReportPostRequest 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
|
||||
|
||||
### NewV1ProblemReportPostRequestWithDefaults
|
||||
|
||||
`func NewV1ProblemReportPostRequestWithDefaults() *V1ProblemReportPostRequest`
|
||||
|
||||
NewV1ProblemReportPostRequestWithDefaults instantiates a new V1ProblemReportPostRequest 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 *V1ProblemReportPostRequest) GetAddress() string`
|
||||
|
||||
GetAddress returns the Address field if non-nil, zero value otherwise.
|
||||
|
||||
### GetAddressOk
|
||||
|
||||
`func (o *V1ProblemReportPostRequest) 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 *V1ProblemReportPostRequest) SetAddress(v string)`
|
||||
|
||||
SetAddress sets Address field to given value.
|
||||
|
||||
### HasAddress
|
||||
|
||||
`func (o *V1ProblemReportPostRequest) HasAddress() bool`
|
||||
|
||||
HasAddress returns a boolean if a field has been set.
|
||||
|
||||
### GetMessage
|
||||
|
||||
`func (o *V1ProblemReportPostRequest) GetMessage() string`
|
||||
|
||||
GetMessage returns the Message field if non-nil, zero value otherwise.
|
||||
|
||||
### GetMessageOk
|
||||
|
||||
`func (o *V1ProblemReportPostRequest) GetMessageOk() (*string, bool)`
|
||||
|
||||
GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetMessage
|
||||
|
||||
`func (o *V1ProblemReportPostRequest) SetMessage(v string)`
|
||||
|
||||
SetMessage sets Message field to given value.
|
||||
|
||||
### HasMessage
|
||||
|
||||
`func (o *V1ProblemReportPostRequest) HasMessage() bool`
|
||||
|
||||
HasMessage returns a boolean if a field has been set.
|
||||
|
||||
### GetLog
|
||||
|
||||
`func (o *V1ProblemReportPostRequest) GetLog() string`
|
||||
|
||||
GetLog returns the Log field if non-nil, zero value otherwise.
|
||||
|
||||
### GetLogOk
|
||||
|
||||
`func (o *V1ProblemReportPostRequest) GetLogOk() (*string, bool)`
|
||||
|
||||
GetLogOk returns a tuple with the Log field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetLog
|
||||
|
||||
`func (o *V1ProblemReportPostRequest) SetLog(v string)`
|
||||
|
||||
SetLog sets Log field to given value.
|
||||
|
||||
|
||||
### GetMetadata
|
||||
|
||||
`func (o *V1ProblemReportPostRequest) GetMetadata() map[string]interface{}`
|
||||
|
||||
GetMetadata returns the Metadata field if non-nil, zero value otherwise.
|
||||
|
||||
### GetMetadataOk
|
||||
|
||||
`func (o *V1ProblemReportPostRequest) GetMetadataOk() (*map[string]interface{}, bool)`
|
||||
|
||||
GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetMetadata
|
||||
|
||||
`func (o *V1ProblemReportPostRequest) SetMetadata(v map[string]interface{})`
|
||||
|
||||
SetMetadata sets Metadata 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)
|
||||
|
||||
|
134
pkg/mullvad_api/docs/V1RelaysGet200Response.md
Normal file
134
pkg/mullvad_api/docs/V1RelaysGet200Response.md
Normal file
@ -0,0 +1,134 @@
|
||||
# V1RelaysGet200Response
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Locations** | Pointer to [**map[string]Location**](Location.md) | | [optional]
|
||||
**Openvpn** | Pointer to [**V1RelaysGet200ResponseOpenvpn**](V1RelaysGet200ResponseOpenvpn.md) | | [optional]
|
||||
**Wireguard** | Pointer to [**V1RelaysGet200ResponseWireguard**](V1RelaysGet200ResponseWireguard.md) | | [optional]
|
||||
**Bridge** | Pointer to [**V1RelaysGet200ResponseBridge**](V1RelaysGet200ResponseBridge.md) | | [optional]
|
||||
|
||||
## Methods
|
||||
|
||||
### NewV1RelaysGet200Response
|
||||
|
||||
`func NewV1RelaysGet200Response() *V1RelaysGet200Response`
|
||||
|
||||
NewV1RelaysGet200Response instantiates a new V1RelaysGet200Response 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
|
||||
|
||||
### NewV1RelaysGet200ResponseWithDefaults
|
||||
|
||||
`func NewV1RelaysGet200ResponseWithDefaults() *V1RelaysGet200Response`
|
||||
|
||||
NewV1RelaysGet200ResponseWithDefaults instantiates a new V1RelaysGet200Response 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
|
||||
|
||||
### GetLocations
|
||||
|
||||
`func (o *V1RelaysGet200Response) GetLocations() map[string]Location`
|
||||
|
||||
GetLocations returns the Locations field if non-nil, zero value otherwise.
|
||||
|
||||
### GetLocationsOk
|
||||
|
||||
`func (o *V1RelaysGet200Response) GetLocationsOk() (*map[string]Location, bool)`
|
||||
|
||||
GetLocationsOk returns a tuple with the Locations field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetLocations
|
||||
|
||||
`func (o *V1RelaysGet200Response) SetLocations(v map[string]Location)`
|
||||
|
||||
SetLocations sets Locations field to given value.
|
||||
|
||||
### HasLocations
|
||||
|
||||
`func (o *V1RelaysGet200Response) HasLocations() bool`
|
||||
|
||||
HasLocations returns a boolean if a field has been set.
|
||||
|
||||
### GetOpenvpn
|
||||
|
||||
`func (o *V1RelaysGet200Response) GetOpenvpn() V1RelaysGet200ResponseOpenvpn`
|
||||
|
||||
GetOpenvpn returns the Openvpn field if non-nil, zero value otherwise.
|
||||
|
||||
### GetOpenvpnOk
|
||||
|
||||
`func (o *V1RelaysGet200Response) GetOpenvpnOk() (*V1RelaysGet200ResponseOpenvpn, bool)`
|
||||
|
||||
GetOpenvpnOk returns a tuple with the Openvpn field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetOpenvpn
|
||||
|
||||
`func (o *V1RelaysGet200Response) SetOpenvpn(v V1RelaysGet200ResponseOpenvpn)`
|
||||
|
||||
SetOpenvpn sets Openvpn field to given value.
|
||||
|
||||
### HasOpenvpn
|
||||
|
||||
`func (o *V1RelaysGet200Response) HasOpenvpn() bool`
|
||||
|
||||
HasOpenvpn returns a boolean if a field has been set.
|
||||
|
||||
### GetWireguard
|
||||
|
||||
`func (o *V1RelaysGet200Response) GetWireguard() V1RelaysGet200ResponseWireguard`
|
||||
|
||||
GetWireguard returns the Wireguard field if non-nil, zero value otherwise.
|
||||
|
||||
### GetWireguardOk
|
||||
|
||||
`func (o *V1RelaysGet200Response) GetWireguardOk() (*V1RelaysGet200ResponseWireguard, bool)`
|
||||
|
||||
GetWireguardOk returns a tuple with the Wireguard field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetWireguard
|
||||
|
||||
`func (o *V1RelaysGet200Response) SetWireguard(v V1RelaysGet200ResponseWireguard)`
|
||||
|
||||
SetWireguard sets Wireguard field to given value.
|
||||
|
||||
### HasWireguard
|
||||
|
||||
`func (o *V1RelaysGet200Response) HasWireguard() bool`
|
||||
|
||||
HasWireguard returns a boolean if a field has been set.
|
||||
|
||||
### GetBridge
|
||||
|
||||
`func (o *V1RelaysGet200Response) GetBridge() V1RelaysGet200ResponseBridge`
|
||||
|
||||
GetBridge returns the Bridge field if non-nil, zero value otherwise.
|
||||
|
||||
### GetBridgeOk
|
||||
|
||||
`func (o *V1RelaysGet200Response) GetBridgeOk() (*V1RelaysGet200ResponseBridge, bool)`
|
||||
|
||||
GetBridgeOk returns a tuple with the Bridge field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetBridge
|
||||
|
||||
`func (o *V1RelaysGet200Response) SetBridge(v V1RelaysGet200ResponseBridge)`
|
||||
|
||||
SetBridge sets Bridge field to given value.
|
||||
|
||||
### HasBridge
|
||||
|
||||
`func (o *V1RelaysGet200Response) HasBridge() bool`
|
||||
|
||||
HasBridge 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)
|
||||
|
||||
|
82
pkg/mullvad_api/docs/V1RelaysGet200ResponseBridge.md
Normal file
82
pkg/mullvad_api/docs/V1RelaysGet200ResponseBridge.md
Normal file
@ -0,0 +1,82 @@
|
||||
# V1RelaysGet200ResponseBridge
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Shadowsocks** | Pointer to [**[]V1RelaysGet200ResponseBridgeShadowsocksInner**](V1RelaysGet200ResponseBridgeShadowsocksInner.md) | List of connection specs for Shadowsocks ports | [optional]
|
||||
**Relays** | Pointer to [**[]BridgeRelay**](BridgeRelay.md) | | [optional]
|
||||
|
||||
## Methods
|
||||
|
||||
### NewV1RelaysGet200ResponseBridge
|
||||
|
||||
`func NewV1RelaysGet200ResponseBridge() *V1RelaysGet200ResponseBridge`
|
||||
|
||||
NewV1RelaysGet200ResponseBridge instantiates a new V1RelaysGet200ResponseBridge 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
|
||||
|
||||
### NewV1RelaysGet200ResponseBridgeWithDefaults
|
||||
|
||||
`func NewV1RelaysGet200ResponseBridgeWithDefaults() *V1RelaysGet200ResponseBridge`
|
||||
|
||||
NewV1RelaysGet200ResponseBridgeWithDefaults instantiates a new V1RelaysGet200ResponseBridge 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
|
||||
|
||||
### GetShadowsocks
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridge) GetShadowsocks() []V1RelaysGet200ResponseBridgeShadowsocksInner`
|
||||
|
||||
GetShadowsocks returns the Shadowsocks field if non-nil, zero value otherwise.
|
||||
|
||||
### GetShadowsocksOk
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridge) GetShadowsocksOk() (*[]V1RelaysGet200ResponseBridgeShadowsocksInner, bool)`
|
||||
|
||||
GetShadowsocksOk returns a tuple with the Shadowsocks field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetShadowsocks
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridge) SetShadowsocks(v []V1RelaysGet200ResponseBridgeShadowsocksInner)`
|
||||
|
||||
SetShadowsocks sets Shadowsocks field to given value.
|
||||
|
||||
### HasShadowsocks
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridge) HasShadowsocks() bool`
|
||||
|
||||
HasShadowsocks returns a boolean if a field has been set.
|
||||
|
||||
### GetRelays
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridge) GetRelays() []BridgeRelay`
|
||||
|
||||
GetRelays returns the Relays field if non-nil, zero value otherwise.
|
||||
|
||||
### GetRelaysOk
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridge) GetRelaysOk() (*[]BridgeRelay, bool)`
|
||||
|
||||
GetRelaysOk returns a tuple with the Relays field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetRelays
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridge) SetRelays(v []BridgeRelay)`
|
||||
|
||||
SetRelays sets Relays field to given value.
|
||||
|
||||
### HasRelays
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridge) HasRelays() bool`
|
||||
|
||||
HasRelays 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)
|
||||
|
||||
|
@ -0,0 +1,134 @@
|
||||
# V1RelaysGet200ResponseBridgeShadowsocksInner
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Protocol** | Pointer to **string** | | [optional]
|
||||
**Port** | Pointer to **int32** | | [optional]
|
||||
**Cipher** | Pointer to **string** | | [optional]
|
||||
**Password** | Pointer to **string** | | [optional]
|
||||
|
||||
## Methods
|
||||
|
||||
### NewV1RelaysGet200ResponseBridgeShadowsocksInner
|
||||
|
||||
`func NewV1RelaysGet200ResponseBridgeShadowsocksInner() *V1RelaysGet200ResponseBridgeShadowsocksInner`
|
||||
|
||||
NewV1RelaysGet200ResponseBridgeShadowsocksInner instantiates a new V1RelaysGet200ResponseBridgeShadowsocksInner 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
|
||||
|
||||
### NewV1RelaysGet200ResponseBridgeShadowsocksInnerWithDefaults
|
||||
|
||||
`func NewV1RelaysGet200ResponseBridgeShadowsocksInnerWithDefaults() *V1RelaysGet200ResponseBridgeShadowsocksInner`
|
||||
|
||||
NewV1RelaysGet200ResponseBridgeShadowsocksInnerWithDefaults instantiates a new V1RelaysGet200ResponseBridgeShadowsocksInner 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
|
||||
|
||||
### GetProtocol
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) GetProtocol() string`
|
||||
|
||||
GetProtocol returns the Protocol field if non-nil, zero value otherwise.
|
||||
|
||||
### GetProtocolOk
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) GetProtocolOk() (*string, bool)`
|
||||
|
||||
GetProtocolOk returns a tuple with the Protocol field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetProtocol
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) SetProtocol(v string)`
|
||||
|
||||
SetProtocol sets Protocol field to given value.
|
||||
|
||||
### HasProtocol
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) HasProtocol() bool`
|
||||
|
||||
HasProtocol returns a boolean if a field has been set.
|
||||
|
||||
### GetPort
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) GetPort() int32`
|
||||
|
||||
GetPort returns the Port field if non-nil, zero value otherwise.
|
||||
|
||||
### GetPortOk
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) GetPortOk() (*int32, bool)`
|
||||
|
||||
GetPortOk returns a tuple with the Port field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetPort
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) SetPort(v int32)`
|
||||
|
||||
SetPort sets Port field to given value.
|
||||
|
||||
### HasPort
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) HasPort() bool`
|
||||
|
||||
HasPort returns a boolean if a field has been set.
|
||||
|
||||
### GetCipher
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) GetCipher() string`
|
||||
|
||||
GetCipher returns the Cipher field if non-nil, zero value otherwise.
|
||||
|
||||
### GetCipherOk
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) GetCipherOk() (*string, bool)`
|
||||
|
||||
GetCipherOk returns a tuple with the Cipher field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetCipher
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) SetCipher(v string)`
|
||||
|
||||
SetCipher sets Cipher field to given value.
|
||||
|
||||
### HasCipher
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) HasCipher() bool`
|
||||
|
||||
HasCipher returns a boolean if a field has been set.
|
||||
|
||||
### GetPassword
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) GetPassword() string`
|
||||
|
||||
GetPassword returns the Password field if non-nil, zero value otherwise.
|
||||
|
||||
### GetPasswordOk
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) GetPasswordOk() (*string, bool)`
|
||||
|
||||
GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetPassword
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) SetPassword(v string)`
|
||||
|
||||
SetPassword sets Password field to given value.
|
||||
|
||||
### HasPassword
|
||||
|
||||
`func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) HasPassword() bool`
|
||||
|
||||
HasPassword 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)
|
||||
|
||||
|
82
pkg/mullvad_api/docs/V1RelaysGet200ResponseOpenvpn.md
Normal file
82
pkg/mullvad_api/docs/V1RelaysGet200ResponseOpenvpn.md
Normal file
@ -0,0 +1,82 @@
|
||||
# V1RelaysGet200ResponseOpenvpn
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Ports** | Pointer to [**[]V1RelaysGet200ResponseOpenvpnPortsInner**](V1RelaysGet200ResponseOpenvpnPortsInner.md) | Pairs of port/protocol that will accept connections | [optional]
|
||||
**Relays** | Pointer to [**[]OpenVpnRelay**](OpenVpnRelay.md) | | [optional]
|
||||
|
||||
## Methods
|
||||
|
||||
### NewV1RelaysGet200ResponseOpenvpn
|
||||
|
||||
`func NewV1RelaysGet200ResponseOpenvpn() *V1RelaysGet200ResponseOpenvpn`
|
||||
|
||||
NewV1RelaysGet200ResponseOpenvpn instantiates a new V1RelaysGet200ResponseOpenvpn 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
|
||||
|
||||
### NewV1RelaysGet200ResponseOpenvpnWithDefaults
|
||||
|
||||
`func NewV1RelaysGet200ResponseOpenvpnWithDefaults() *V1RelaysGet200ResponseOpenvpn`
|
||||
|
||||
NewV1RelaysGet200ResponseOpenvpnWithDefaults instantiates a new V1RelaysGet200ResponseOpenvpn 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
|
||||
|
||||
### GetPorts
|
||||
|
||||
`func (o *V1RelaysGet200ResponseOpenvpn) GetPorts() []V1RelaysGet200ResponseOpenvpnPortsInner`
|
||||
|
||||
GetPorts returns the Ports field if non-nil, zero value otherwise.
|
||||
|
||||
### GetPortsOk
|
||||
|
||||
`func (o *V1RelaysGet200ResponseOpenvpn) GetPortsOk() (*[]V1RelaysGet200ResponseOpenvpnPortsInner, bool)`
|
||||
|
||||
GetPortsOk returns a tuple with the Ports field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetPorts
|
||||
|
||||
`func (o *V1RelaysGet200ResponseOpenvpn) SetPorts(v []V1RelaysGet200ResponseOpenvpnPortsInner)`
|
||||
|
||||
SetPorts sets Ports field to given value.
|
||||
|
||||
### HasPorts
|
||||
|
||||
`func (o *V1RelaysGet200ResponseOpenvpn) HasPorts() bool`
|
||||
|
||||
HasPorts returns a boolean if a field has been set.
|
||||
|
||||
### GetRelays
|
||||
|
||||
`func (o *V1RelaysGet200ResponseOpenvpn) GetRelays() []OpenVpnRelay`
|
||||
|
||||
GetRelays returns the Relays field if non-nil, zero value otherwise.
|
||||
|
||||
### GetRelaysOk
|
||||
|
||||
`func (o *V1RelaysGet200ResponseOpenvpn) GetRelaysOk() (*[]OpenVpnRelay, bool)`
|
||||
|
||||
GetRelaysOk returns a tuple with the Relays field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetRelays
|
||||
|
||||
`func (o *V1RelaysGet200ResponseOpenvpn) SetRelays(v []OpenVpnRelay)`
|
||||
|
||||
SetRelays sets Relays field to given value.
|
||||
|
||||
### HasRelays
|
||||
|
||||
`func (o *V1RelaysGet200ResponseOpenvpn) HasRelays() bool`
|
||||
|
||||
HasRelays 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)
|
||||
|
||||
|
@ -0,0 +1,82 @@
|
||||
# V1RelaysGet200ResponseOpenvpnPortsInner
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Port** | Pointer to **float32** | | [optional]
|
||||
**Protocol** | Pointer to **string** | | [optional]
|
||||
|
||||
## Methods
|
||||
|
||||
### NewV1RelaysGet200ResponseOpenvpnPortsInner
|
||||
|
||||
`func NewV1RelaysGet200ResponseOpenvpnPortsInner() *V1RelaysGet200ResponseOpenvpnPortsInner`
|
||||
|
||||
NewV1RelaysGet200ResponseOpenvpnPortsInner instantiates a new V1RelaysGet200ResponseOpenvpnPortsInner 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
|
||||
|
||||
### NewV1RelaysGet200ResponseOpenvpnPortsInnerWithDefaults
|
||||
|
||||
`func NewV1RelaysGet200ResponseOpenvpnPortsInnerWithDefaults() *V1RelaysGet200ResponseOpenvpnPortsInner`
|
||||
|
||||
NewV1RelaysGet200ResponseOpenvpnPortsInnerWithDefaults instantiates a new V1RelaysGet200ResponseOpenvpnPortsInner 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
|
||||
|
||||
### GetPort
|
||||
|
||||
`func (o *V1RelaysGet200ResponseOpenvpnPortsInner) GetPort() float32`
|
||||
|
||||
GetPort returns the Port field if non-nil, zero value otherwise.
|
||||
|
||||
### GetPortOk
|
||||
|
||||
`func (o *V1RelaysGet200ResponseOpenvpnPortsInner) GetPortOk() (*float32, bool)`
|
||||
|
||||
GetPortOk returns a tuple with the Port field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetPort
|
||||
|
||||
`func (o *V1RelaysGet200ResponseOpenvpnPortsInner) SetPort(v float32)`
|
||||
|
||||
SetPort sets Port field to given value.
|
||||
|
||||
### HasPort
|
||||
|
||||
`func (o *V1RelaysGet200ResponseOpenvpnPortsInner) HasPort() bool`
|
||||
|
||||
HasPort returns a boolean if a field has been set.
|
||||
|
||||
### GetProtocol
|
||||
|
||||
`func (o *V1RelaysGet200ResponseOpenvpnPortsInner) GetProtocol() string`
|
||||
|
||||
GetProtocol returns the Protocol field if non-nil, zero value otherwise.
|
||||
|
||||
### GetProtocolOk
|
||||
|
||||
`func (o *V1RelaysGet200ResponseOpenvpnPortsInner) GetProtocolOk() (*string, bool)`
|
||||
|
||||
GetProtocolOk returns a tuple with the Protocol field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetProtocol
|
||||
|
||||
`func (o *V1RelaysGet200ResponseOpenvpnPortsInner) SetProtocol(v string)`
|
||||
|
||||
SetProtocol sets Protocol field to given value.
|
||||
|
||||
### HasProtocol
|
||||
|
||||
`func (o *V1RelaysGet200ResponseOpenvpnPortsInner) HasProtocol() bool`
|
||||
|
||||
HasProtocol 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)
|
||||
|
||||
|
134
pkg/mullvad_api/docs/V1RelaysGet200ResponseWireguard.md
Normal file
134
pkg/mullvad_api/docs/V1RelaysGet200ResponseWireguard.md
Normal file
@ -0,0 +1,134 @@
|
||||
# V1RelaysGet200ResponseWireguard
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**PortRanges** | Pointer to **[][]int32** | List of port ranges that will accept connections | [optional]
|
||||
**Ipv4Gateway** | Pointer to **string** | The ipv4 gateway of the server, you can ping it to check whether a tunnel is connected or not. | [optional]
|
||||
**Ipv6Gateway** | Pointer to **string** | The ipv6 gateway of the server, you can ping it to check whether a tunnel is connected or not. | [optional]
|
||||
**Relays** | Pointer to [**[]WireGuardRelay**](WireGuardRelay.md) | | [optional]
|
||||
|
||||
## Methods
|
||||
|
||||
### NewV1RelaysGet200ResponseWireguard
|
||||
|
||||
`func NewV1RelaysGet200ResponseWireguard() *V1RelaysGet200ResponseWireguard`
|
||||
|
||||
NewV1RelaysGet200ResponseWireguard instantiates a new V1RelaysGet200ResponseWireguard 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
|
||||
|
||||
### NewV1RelaysGet200ResponseWireguardWithDefaults
|
||||
|
||||
`func NewV1RelaysGet200ResponseWireguardWithDefaults() *V1RelaysGet200ResponseWireguard`
|
||||
|
||||
NewV1RelaysGet200ResponseWireguardWithDefaults instantiates a new V1RelaysGet200ResponseWireguard 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
|
||||
|
||||
### GetPortRanges
|
||||
|
||||
`func (o *V1RelaysGet200ResponseWireguard) GetPortRanges() [][]int32`
|
||||
|
||||
GetPortRanges returns the PortRanges field if non-nil, zero value otherwise.
|
||||
|
||||
### GetPortRangesOk
|
||||
|
||||
`func (o *V1RelaysGet200ResponseWireguard) GetPortRangesOk() (*[][]int32, bool)`
|
||||
|
||||
GetPortRangesOk returns a tuple with the PortRanges field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetPortRanges
|
||||
|
||||
`func (o *V1RelaysGet200ResponseWireguard) SetPortRanges(v [][]int32)`
|
||||
|
||||
SetPortRanges sets PortRanges field to given value.
|
||||
|
||||
### HasPortRanges
|
||||
|
||||
`func (o *V1RelaysGet200ResponseWireguard) HasPortRanges() bool`
|
||||
|
||||
HasPortRanges returns a boolean if a field has been set.
|
||||
|
||||
### GetIpv4Gateway
|
||||
|
||||
`func (o *V1RelaysGet200ResponseWireguard) GetIpv4Gateway() string`
|
||||
|
||||
GetIpv4Gateway returns the Ipv4Gateway field if non-nil, zero value otherwise.
|
||||
|
||||
### GetIpv4GatewayOk
|
||||
|
||||
`func (o *V1RelaysGet200ResponseWireguard) GetIpv4GatewayOk() (*string, bool)`
|
||||
|
||||
GetIpv4GatewayOk returns a tuple with the Ipv4Gateway field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetIpv4Gateway
|
||||
|
||||
`func (o *V1RelaysGet200ResponseWireguard) SetIpv4Gateway(v string)`
|
||||
|
||||
SetIpv4Gateway sets Ipv4Gateway field to given value.
|
||||
|
||||
### HasIpv4Gateway
|
||||
|
||||
`func (o *V1RelaysGet200ResponseWireguard) HasIpv4Gateway() bool`
|
||||
|
||||
HasIpv4Gateway returns a boolean if a field has been set.
|
||||
|
||||
### GetIpv6Gateway
|
||||
|
||||
`func (o *V1RelaysGet200ResponseWireguard) GetIpv6Gateway() string`
|
||||
|
||||
GetIpv6Gateway returns the Ipv6Gateway field if non-nil, zero value otherwise.
|
||||
|
||||
### GetIpv6GatewayOk
|
||||
|
||||
`func (o *V1RelaysGet200ResponseWireguard) GetIpv6GatewayOk() (*string, bool)`
|
||||
|
||||
GetIpv6GatewayOk returns a tuple with the Ipv6Gateway field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetIpv6Gateway
|
||||
|
||||
`func (o *V1RelaysGet200ResponseWireguard) SetIpv6Gateway(v string)`
|
||||
|
||||
SetIpv6Gateway sets Ipv6Gateway field to given value.
|
||||
|
||||
### HasIpv6Gateway
|
||||
|
||||
`func (o *V1RelaysGet200ResponseWireguard) HasIpv6Gateway() bool`
|
||||
|
||||
HasIpv6Gateway returns a boolean if a field has been set.
|
||||
|
||||
### GetRelays
|
||||
|
||||
`func (o *V1RelaysGet200ResponseWireguard) GetRelays() []WireGuardRelay`
|
||||
|
||||
GetRelays returns the Relays field if non-nil, zero value otherwise.
|
||||
|
||||
### GetRelaysOk
|
||||
|
||||
`func (o *V1RelaysGet200ResponseWireguard) GetRelaysOk() (*[]WireGuardRelay, bool)`
|
||||
|
||||
GetRelaysOk returns a tuple with the Relays field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetRelays
|
||||
|
||||
`func (o *V1RelaysGet200ResponseWireguard) SetRelays(v []WireGuardRelay)`
|
||||
|
||||
SetRelays sets Relays field to given value.
|
||||
|
||||
### HasRelays
|
||||
|
||||
`func (o *V1RelaysGet200ResponseWireguard) HasRelays() bool`
|
||||
|
||||
HasRelays 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)
|
||||
|
||||
|
164
pkg/mullvad_api/docs/V1ReleasesPlatformVersionGet200Response.md
Normal file
164
pkg/mullvad_api/docs/V1ReleasesPlatformVersionGet200Response.md
Normal file
@ -0,0 +1,164 @@
|
||||
# V1ReleasesPlatformVersionGet200Response
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Supported** | Pointer to **bool** | | [optional]
|
||||
**Latest** | Pointer to **NullableString** | | [optional]
|
||||
**LatestStable** | Pointer to **NullableString** | | [optional]
|
||||
**LatestBeta** | Pointer to **NullableString** | | [optional]
|
||||
|
||||
## Methods
|
||||
|
||||
### NewV1ReleasesPlatformVersionGet200Response
|
||||
|
||||
`func NewV1ReleasesPlatformVersionGet200Response() *V1ReleasesPlatformVersionGet200Response`
|
||||
|
||||
NewV1ReleasesPlatformVersionGet200Response instantiates a new V1ReleasesPlatformVersionGet200Response 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
|
||||
|
||||
### NewV1ReleasesPlatformVersionGet200ResponseWithDefaults
|
||||
|
||||
`func NewV1ReleasesPlatformVersionGet200ResponseWithDefaults() *V1ReleasesPlatformVersionGet200Response`
|
||||
|
||||
NewV1ReleasesPlatformVersionGet200ResponseWithDefaults instantiates a new V1ReleasesPlatformVersionGet200Response 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
|
||||
|
||||
### GetSupported
|
||||
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) GetSupported() bool`
|
||||
|
||||
GetSupported returns the Supported field if non-nil, zero value otherwise.
|
||||
|
||||
### GetSupportedOk
|
||||
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) GetSupportedOk() (*bool, bool)`
|
||||
|
||||
GetSupportedOk returns a tuple with the Supported field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetSupported
|
||||
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) SetSupported(v bool)`
|
||||
|
||||
SetSupported sets Supported field to given value.
|
||||
|
||||
### HasSupported
|
||||
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) HasSupported() bool`
|
||||
|
||||
HasSupported returns a boolean if a field has been set.
|
||||
|
||||
### GetLatest
|
||||
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) GetLatest() string`
|
||||
|
||||
GetLatest returns the Latest field if non-nil, zero value otherwise.
|
||||
|
||||
### GetLatestOk
|
||||
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) GetLatestOk() (*string, bool)`
|
||||
|
||||
GetLatestOk returns a tuple with the Latest field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetLatest
|
||||
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) SetLatest(v string)`
|
||||
|
||||
SetLatest sets Latest field to given value.
|
||||
|
||||
### HasLatest
|
||||
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) HasLatest() bool`
|
||||
|
||||
HasLatest returns a boolean if a field has been set.
|
||||
|
||||
### SetLatestNil
|
||||
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) SetLatestNil(b bool)`
|
||||
|
||||
SetLatestNil sets the value for Latest to be an explicit nil
|
||||
|
||||
### UnsetLatest
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) UnsetLatest()`
|
||||
|
||||
UnsetLatest ensures that no value is present for Latest, not even an explicit nil
|
||||
### GetLatestStable
|
||||
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) GetLatestStable() string`
|
||||
|
||||
GetLatestStable returns the LatestStable field if non-nil, zero value otherwise.
|
||||
|
||||
### GetLatestStableOk
|
||||
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) GetLatestStableOk() (*string, bool)`
|
||||
|
||||
GetLatestStableOk returns a tuple with the LatestStable field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetLatestStable
|
||||
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) SetLatestStable(v string)`
|
||||
|
||||
SetLatestStable sets LatestStable field to given value.
|
||||
|
||||
### HasLatestStable
|
||||
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) HasLatestStable() bool`
|
||||
|
||||
HasLatestStable returns a boolean if a field has been set.
|
||||
|
||||
### SetLatestStableNil
|
||||
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) SetLatestStableNil(b bool)`
|
||||
|
||||
SetLatestStableNil sets the value for LatestStable to be an explicit nil
|
||||
|
||||
### UnsetLatestStable
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) UnsetLatestStable()`
|
||||
|
||||
UnsetLatestStable ensures that no value is present for LatestStable, not even an explicit nil
|
||||
### GetLatestBeta
|
||||
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) GetLatestBeta() string`
|
||||
|
||||
GetLatestBeta returns the LatestBeta field if non-nil, zero value otherwise.
|
||||
|
||||
### GetLatestBetaOk
|
||||
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) GetLatestBetaOk() (*string, bool)`
|
||||
|
||||
GetLatestBetaOk returns a tuple with the LatestBeta field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetLatestBeta
|
||||
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) SetLatestBeta(v string)`
|
||||
|
||||
SetLatestBeta sets LatestBeta field to given value.
|
||||
|
||||
### HasLatestBeta
|
||||
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) HasLatestBeta() bool`
|
||||
|
||||
HasLatestBeta returns a boolean if a field has been set.
|
||||
|
||||
### SetLatestBetaNil
|
||||
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) SetLatestBetaNil(b bool)`
|
||||
|
||||
SetLatestBetaNil sets the value for LatestBeta to be an explicit nil
|
||||
|
||||
### UnsetLatestBeta
|
||||
`func (o *V1ReleasesPlatformVersionGet200Response) UnsetLatestBeta()`
|
||||
|
||||
UnsetLatestBeta ensures that no value is present for LatestBeta, not even an explicit nil
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
72
pkg/mullvad_api/docs/V1ReplaceWireguardKeyPostRequest.md
Normal file
72
pkg/mullvad_api/docs/V1ReplaceWireguardKeyPostRequest.md
Normal file
@ -0,0 +1,72 @@
|
||||
# V1ReplaceWireguardKeyPostRequest
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Old** | **string** | The WireGuard public key to remove |
|
||||
**New** | **string** | The WireGuard public key to add |
|
||||
|
||||
## Methods
|
||||
|
||||
### NewV1ReplaceWireguardKeyPostRequest
|
||||
|
||||
`func NewV1ReplaceWireguardKeyPostRequest(old string, new string, ) *V1ReplaceWireguardKeyPostRequest`
|
||||
|
||||
NewV1ReplaceWireguardKeyPostRequest instantiates a new V1ReplaceWireguardKeyPostRequest 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
|
||||
|
||||
### NewV1ReplaceWireguardKeyPostRequestWithDefaults
|
||||
|
||||
`func NewV1ReplaceWireguardKeyPostRequestWithDefaults() *V1ReplaceWireguardKeyPostRequest`
|
||||
|
||||
NewV1ReplaceWireguardKeyPostRequestWithDefaults instantiates a new V1ReplaceWireguardKeyPostRequest 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
|
||||
|
||||
### GetOld
|
||||
|
||||
`func (o *V1ReplaceWireguardKeyPostRequest) GetOld() string`
|
||||
|
||||
GetOld returns the Old field if non-nil, zero value otherwise.
|
||||
|
||||
### GetOldOk
|
||||
|
||||
`func (o *V1ReplaceWireguardKeyPostRequest) GetOldOk() (*string, bool)`
|
||||
|
||||
GetOldOk returns a tuple with the Old field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetOld
|
||||
|
||||
`func (o *V1ReplaceWireguardKeyPostRequest) SetOld(v string)`
|
||||
|
||||
SetOld sets Old field to given value.
|
||||
|
||||
|
||||
### GetNew
|
||||
|
||||
`func (o *V1ReplaceWireguardKeyPostRequest) GetNew() string`
|
||||
|
||||
GetNew returns the New field if non-nil, zero value otherwise.
|
||||
|
||||
### GetNewOk
|
||||
|
||||
`func (o *V1ReplaceWireguardKeyPostRequest) GetNewOk() (*string, bool)`
|
||||
|
||||
GetNewOk returns a tuple with the New field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetNew
|
||||
|
||||
`func (o *V1ReplaceWireguardKeyPostRequest) SetNew(v string)`
|
||||
|
||||
SetNew sets New 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)
|
||||
|
||||
|
82
pkg/mullvad_api/docs/V1SubmitVoucherPost200Response.md
Normal file
82
pkg/mullvad_api/docs/V1SubmitVoucherPost200Response.md
Normal file
@ -0,0 +1,82 @@
|
||||
# V1SubmitVoucherPost200Response
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**TimeAdded** | Pointer to **float32** | | [optional]
|
||||
**NewExpiry** | Pointer to **string** | | [optional]
|
||||
|
||||
## Methods
|
||||
|
||||
### NewV1SubmitVoucherPost200Response
|
||||
|
||||
`func NewV1SubmitVoucherPost200Response() *V1SubmitVoucherPost200Response`
|
||||
|
||||
NewV1SubmitVoucherPost200Response instantiates a new V1SubmitVoucherPost200Response 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
|
||||
|
||||
### NewV1SubmitVoucherPost200ResponseWithDefaults
|
||||
|
||||
`func NewV1SubmitVoucherPost200ResponseWithDefaults() *V1SubmitVoucherPost200Response`
|
||||
|
||||
NewV1SubmitVoucherPost200ResponseWithDefaults instantiates a new V1SubmitVoucherPost200Response 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
|
||||
|
||||
### GetTimeAdded
|
||||
|
||||
`func (o *V1SubmitVoucherPost200Response) GetTimeAdded() float32`
|
||||
|
||||
GetTimeAdded returns the TimeAdded field if non-nil, zero value otherwise.
|
||||
|
||||
### GetTimeAddedOk
|
||||
|
||||
`func (o *V1SubmitVoucherPost200Response) GetTimeAddedOk() (*float32, bool)`
|
||||
|
||||
GetTimeAddedOk returns a tuple with the TimeAdded field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetTimeAdded
|
||||
|
||||
`func (o *V1SubmitVoucherPost200Response) SetTimeAdded(v float32)`
|
||||
|
||||
SetTimeAdded sets TimeAdded field to given value.
|
||||
|
||||
### HasTimeAdded
|
||||
|
||||
`func (o *V1SubmitVoucherPost200Response) HasTimeAdded() bool`
|
||||
|
||||
HasTimeAdded returns a boolean if a field has been set.
|
||||
|
||||
### GetNewExpiry
|
||||
|
||||
`func (o *V1SubmitVoucherPost200Response) GetNewExpiry() string`
|
||||
|
||||
GetNewExpiry returns the NewExpiry field if non-nil, zero value otherwise.
|
||||
|
||||
### GetNewExpiryOk
|
||||
|
||||
`func (o *V1SubmitVoucherPost200Response) GetNewExpiryOk() (*string, bool)`
|
||||
|
||||
GetNewExpiryOk returns a tuple with the NewExpiry field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetNewExpiry
|
||||
|
||||
`func (o *V1SubmitVoucherPost200Response) SetNewExpiry(v string)`
|
||||
|
||||
SetNewExpiry sets NewExpiry field to given value.
|
||||
|
||||
### HasNewExpiry
|
||||
|
||||
`func (o *V1SubmitVoucherPost200Response) HasNewExpiry() bool`
|
||||
|
||||
HasNewExpiry 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)
|
||||
|
||||
|
51
pkg/mullvad_api/docs/V1SubmitVoucherPostRequest.md
Normal file
51
pkg/mullvad_api/docs/V1SubmitVoucherPostRequest.md
Normal file
@ -0,0 +1,51 @@
|
||||
# V1SubmitVoucherPostRequest
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**VoucherCode** | **string** | |
|
||||
|
||||
## Methods
|
||||
|
||||
### NewV1SubmitVoucherPostRequest
|
||||
|
||||
`func NewV1SubmitVoucherPostRequest(voucherCode string, ) *V1SubmitVoucherPostRequest`
|
||||
|
||||
NewV1SubmitVoucherPostRequest instantiates a new V1SubmitVoucherPostRequest 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
|
||||
|
||||
### NewV1SubmitVoucherPostRequestWithDefaults
|
||||
|
||||
`func NewV1SubmitVoucherPostRequestWithDefaults() *V1SubmitVoucherPostRequest`
|
||||
|
||||
NewV1SubmitVoucherPostRequestWithDefaults instantiates a new V1SubmitVoucherPostRequest 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
|
||||
|
||||
### GetVoucherCode
|
||||
|
||||
`func (o *V1SubmitVoucherPostRequest) GetVoucherCode() string`
|
||||
|
||||
GetVoucherCode returns the VoucherCode field if non-nil, zero value otherwise.
|
||||
|
||||
### GetVoucherCodeOk
|
||||
|
||||
`func (o *V1SubmitVoucherPostRequest) GetVoucherCodeOk() (*string, bool)`
|
||||
|
||||
GetVoucherCodeOk returns a tuple with the VoucherCode field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetVoucherCode
|
||||
|
||||
`func (o *V1SubmitVoucherPostRequest) SetVoucherCode(v string)`
|
||||
|
||||
SetVoucherCode sets VoucherCode 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)
|
||||
|
||||
|
51
pkg/mullvad_api/docs/V1WireguardKeysPostRequest.md
Normal file
51
pkg/mullvad_api/docs/V1WireguardKeysPostRequest.md
Normal file
@ -0,0 +1,51 @@
|
||||
# V1WireguardKeysPostRequest
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Pubkey** | **string** | The WireGuard public key to add |
|
||||
|
||||
## Methods
|
||||
|
||||
### NewV1WireguardKeysPostRequest
|
||||
|
||||
`func NewV1WireguardKeysPostRequest(pubkey string, ) *V1WireguardKeysPostRequest`
|
||||
|
||||
NewV1WireguardKeysPostRequest instantiates a new V1WireguardKeysPostRequest 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
|
||||
|
||||
### NewV1WireguardKeysPostRequestWithDefaults
|
||||
|
||||
`func NewV1WireguardKeysPostRequestWithDefaults() *V1WireguardKeysPostRequest`
|
||||
|
||||
NewV1WireguardKeysPostRequestWithDefaults instantiates a new V1WireguardKeysPostRequest 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
|
||||
|
||||
### GetPubkey
|
||||
|
||||
`func (o *V1WireguardKeysPostRequest) GetPubkey() string`
|
||||
|
||||
GetPubkey returns the Pubkey field if non-nil, zero value otherwise.
|
||||
|
||||
### GetPubkeyOk
|
||||
|
||||
`func (o *V1WireguardKeysPostRequest) GetPubkeyOk() (*string, bool)`
|
||||
|
||||
GetPubkeyOk returns a tuple with the Pubkey field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetPubkey
|
||||
|
||||
`func (o *V1WireguardKeysPostRequest) SetPubkey(v string)`
|
||||
|
||||
SetPubkey sets Pubkey 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)
|
||||
|
||||
|
56
pkg/mullvad_api/docs/V1WwwAuthTokenPost200Response.md
Normal file
56
pkg/mullvad_api/docs/V1WwwAuthTokenPost200Response.md
Normal file
@ -0,0 +1,56 @@
|
||||
# V1WwwAuthTokenPost200Response
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**AuthToken** | Pointer to **string** | | [optional]
|
||||
|
||||
## Methods
|
||||
|
||||
### NewV1WwwAuthTokenPost200Response
|
||||
|
||||
`func NewV1WwwAuthTokenPost200Response() *V1WwwAuthTokenPost200Response`
|
||||
|
||||
NewV1WwwAuthTokenPost200Response instantiates a new V1WwwAuthTokenPost200Response 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
|
||||
|
||||
### NewV1WwwAuthTokenPost200ResponseWithDefaults
|
||||
|
||||
`func NewV1WwwAuthTokenPost200ResponseWithDefaults() *V1WwwAuthTokenPost200Response`
|
||||
|
||||
NewV1WwwAuthTokenPost200ResponseWithDefaults instantiates a new V1WwwAuthTokenPost200Response 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
|
||||
|
||||
### GetAuthToken
|
||||
|
||||
`func (o *V1WwwAuthTokenPost200Response) GetAuthToken() string`
|
||||
|
||||
GetAuthToken returns the AuthToken field if non-nil, zero value otherwise.
|
||||
|
||||
### GetAuthTokenOk
|
||||
|
||||
`func (o *V1WwwAuthTokenPost200Response) GetAuthTokenOk() (*string, bool)`
|
||||
|
||||
GetAuthTokenOk returns a tuple with the AuthToken field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetAuthToken
|
||||
|
||||
`func (o *V1WwwAuthTokenPost200Response) SetAuthToken(v string)`
|
||||
|
||||
SetAuthToken sets AuthToken field to given value.
|
||||
|
||||
### HasAuthToken
|
||||
|
||||
`func (o *V1WwwAuthTokenPost200Response) HasAuthToken() bool`
|
||||
|
||||
HasAuthToken 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)
|
||||
|
||||
|
134
pkg/mullvad_api/docs/WireGuardPubkey.md
Normal file
134
pkg/mullvad_api/docs/WireGuardPubkey.md
Normal file
@ -0,0 +1,134 @@
|
||||
# WireGuardPubkey
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Id** | Pointer to **string** | Convenience field with the public key encoded to use with the API (eg when deleting it), same as the pubkey field but urlencoded. | [optional]
|
||||
**Pubkey** | Pointer to **string** | The WireGuard public key. | [optional]
|
||||
**Ipv4Address** | Pointer to **string** | The ipv4 peer adress for WireGuard. Note that the mask may be bigger then a single IP. | [optional]
|
||||
**Ipv6Address** | Pointer to **string** | The ipv6 peer address for WireGuard. Note that the mask may be bigger then a single IP. | [optional]
|
||||
|
||||
## Methods
|
||||
|
||||
### NewWireGuardPubkey
|
||||
|
||||
`func NewWireGuardPubkey() *WireGuardPubkey`
|
||||
|
||||
NewWireGuardPubkey instantiates a new WireGuardPubkey 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
|
||||
|
||||
### NewWireGuardPubkeyWithDefaults
|
||||
|
||||
`func NewWireGuardPubkeyWithDefaults() *WireGuardPubkey`
|
||||
|
||||
NewWireGuardPubkeyWithDefaults instantiates a new WireGuardPubkey 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
|
||||
|
||||
### GetId
|
||||
|
||||
`func (o *WireGuardPubkey) GetId() string`
|
||||
|
||||
GetId returns the Id field if non-nil, zero value otherwise.
|
||||
|
||||
### GetIdOk
|
||||
|
||||
`func (o *WireGuardPubkey) 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 *WireGuardPubkey) SetId(v string)`
|
||||
|
||||
SetId sets Id field to given value.
|
||||
|
||||
### HasId
|
||||
|
||||
`func (o *WireGuardPubkey) HasId() bool`
|
||||
|
||||
HasId returns a boolean if a field has been set.
|
||||
|
||||
### GetPubkey
|
||||
|
||||
`func (o *WireGuardPubkey) GetPubkey() string`
|
||||
|
||||
GetPubkey returns the Pubkey field if non-nil, zero value otherwise.
|
||||
|
||||
### GetPubkeyOk
|
||||
|
||||
`func (o *WireGuardPubkey) GetPubkeyOk() (*string, bool)`
|
||||
|
||||
GetPubkeyOk returns a tuple with the Pubkey field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetPubkey
|
||||
|
||||
`func (o *WireGuardPubkey) SetPubkey(v string)`
|
||||
|
||||
SetPubkey sets Pubkey field to given value.
|
||||
|
||||
### HasPubkey
|
||||
|
||||
`func (o *WireGuardPubkey) HasPubkey() bool`
|
||||
|
||||
HasPubkey returns a boolean if a field has been set.
|
||||
|
||||
### GetIpv4Address
|
||||
|
||||
`func (o *WireGuardPubkey) GetIpv4Address() string`
|
||||
|
||||
GetIpv4Address returns the Ipv4Address field if non-nil, zero value otherwise.
|
||||
|
||||
### GetIpv4AddressOk
|
||||
|
||||
`func (o *WireGuardPubkey) GetIpv4AddressOk() (*string, bool)`
|
||||
|
||||
GetIpv4AddressOk returns a tuple with the Ipv4Address field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetIpv4Address
|
||||
|
||||
`func (o *WireGuardPubkey) SetIpv4Address(v string)`
|
||||
|
||||
SetIpv4Address sets Ipv4Address field to given value.
|
||||
|
||||
### HasIpv4Address
|
||||
|
||||
`func (o *WireGuardPubkey) HasIpv4Address() bool`
|
||||
|
||||
HasIpv4Address returns a boolean if a field has been set.
|
||||
|
||||
### GetIpv6Address
|
||||
|
||||
`func (o *WireGuardPubkey) GetIpv6Address() string`
|
||||
|
||||
GetIpv6Address returns the Ipv6Address field if non-nil, zero value otherwise.
|
||||
|
||||
### GetIpv6AddressOk
|
||||
|
||||
`func (o *WireGuardPubkey) GetIpv6AddressOk() (*string, bool)`
|
||||
|
||||
GetIpv6AddressOk returns a tuple with the Ipv6Address field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetIpv6Address
|
||||
|
||||
`func (o *WireGuardPubkey) SetIpv6Address(v string)`
|
||||
|
||||
SetIpv6Address sets Ipv6Address field to given value.
|
||||
|
||||
### HasIpv6Address
|
||||
|
||||
`func (o *WireGuardPubkey) HasIpv6Address() bool`
|
||||
|
||||
HasIpv6Address 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)
|
||||
|
||||
|
342
pkg/mullvad_api/docs/WireGuardRelay.md
Normal file
342
pkg/mullvad_api/docs/WireGuardRelay.md
Normal file
@ -0,0 +1,342 @@
|
||||
# WireGuardRelay
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Hostname** | Pointer to **string** | | [optional]
|
||||
**Location** | Pointer to **string** | | [optional]
|
||||
**Active** | Pointer to **bool** | | [optional]
|
||||
**Owned** | Pointer to **bool** | | [optional]
|
||||
**Provider** | Pointer to **string** | | [optional]
|
||||
**Ipv4AddrIn** | Pointer to **string** | | [optional]
|
||||
**IncludeInCountry** | Pointer to **bool** | | [optional]
|
||||
**Weight** | Pointer to **int32** | | [optional]
|
||||
**PublicKey** | Pointer to **string** | | [optional]
|
||||
**Ipv6AddrIn** | Pointer to **string** | | [optional]
|
||||
**SameIp** | Pointer to **bool** | Whether the server supports clients using the same IP address. This flag will be removed once all servers support the feature, so clients should default to True if it's missing. | [optional] [default to true]
|
||||
**Daita** | Pointer to **bool** | If true, clients can expect DAITA to be available on this relay. Note that this field is not guaranteed to be present. A missing `daita` property is semantically equivalent to `\"daita\": false`. | [optional] [default to false]
|
||||
|
||||
## Methods
|
||||
|
||||
### NewWireGuardRelay
|
||||
|
||||
`func NewWireGuardRelay() *WireGuardRelay`
|
||||
|
||||
NewWireGuardRelay instantiates a new WireGuardRelay 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
|
||||
|
||||
### NewWireGuardRelayWithDefaults
|
||||
|
||||
`func NewWireGuardRelayWithDefaults() *WireGuardRelay`
|
||||
|
||||
NewWireGuardRelayWithDefaults instantiates a new WireGuardRelay 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
|
||||
|
||||
### GetHostname
|
||||
|
||||
`func (o *WireGuardRelay) GetHostname() string`
|
||||
|
||||
GetHostname returns the Hostname field if non-nil, zero value otherwise.
|
||||
|
||||
### GetHostnameOk
|
||||
|
||||
`func (o *WireGuardRelay) GetHostnameOk() (*string, bool)`
|
||||
|
||||
GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetHostname
|
||||
|
||||
`func (o *WireGuardRelay) SetHostname(v string)`
|
||||
|
||||
SetHostname sets Hostname field to given value.
|
||||
|
||||
### HasHostname
|
||||
|
||||
`func (o *WireGuardRelay) HasHostname() bool`
|
||||
|
||||
HasHostname returns a boolean if a field has been set.
|
||||
|
||||
### GetLocation
|
||||
|
||||
`func (o *WireGuardRelay) GetLocation() string`
|
||||
|
||||
GetLocation returns the Location field if non-nil, zero value otherwise.
|
||||
|
||||
### GetLocationOk
|
||||
|
||||
`func (o *WireGuardRelay) GetLocationOk() (*string, bool)`
|
||||
|
||||
GetLocationOk returns a tuple with the Location field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetLocation
|
||||
|
||||
`func (o *WireGuardRelay) SetLocation(v string)`
|
||||
|
||||
SetLocation sets Location field to given value.
|
||||
|
||||
### HasLocation
|
||||
|
||||
`func (o *WireGuardRelay) HasLocation() bool`
|
||||
|
||||
HasLocation returns a boolean if a field has been set.
|
||||
|
||||
### GetActive
|
||||
|
||||
`func (o *WireGuardRelay) GetActive() bool`
|
||||
|
||||
GetActive returns the Active field if non-nil, zero value otherwise.
|
||||
|
||||
### GetActiveOk
|
||||
|
||||
`func (o *WireGuardRelay) 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 *WireGuardRelay) SetActive(v bool)`
|
||||
|
||||
SetActive sets Active field to given value.
|
||||
|
||||
### HasActive
|
||||
|
||||
`func (o *WireGuardRelay) HasActive() bool`
|
||||
|
||||
HasActive returns a boolean if a field has been set.
|
||||
|
||||
### GetOwned
|
||||
|
||||
`func (o *WireGuardRelay) GetOwned() bool`
|
||||
|
||||
GetOwned returns the Owned field if non-nil, zero value otherwise.
|
||||
|
||||
### GetOwnedOk
|
||||
|
||||
`func (o *WireGuardRelay) GetOwnedOk() (*bool, bool)`
|
||||
|
||||
GetOwnedOk returns a tuple with the Owned field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetOwned
|
||||
|
||||
`func (o *WireGuardRelay) SetOwned(v bool)`
|
||||
|
||||
SetOwned sets Owned field to given value.
|
||||
|
||||
### HasOwned
|
||||
|
||||
`func (o *WireGuardRelay) HasOwned() bool`
|
||||
|
||||
HasOwned returns a boolean if a field has been set.
|
||||
|
||||
### GetProvider
|
||||
|
||||
`func (o *WireGuardRelay) GetProvider() string`
|
||||
|
||||
GetProvider returns the Provider field if non-nil, zero value otherwise.
|
||||
|
||||
### GetProviderOk
|
||||
|
||||
`func (o *WireGuardRelay) GetProviderOk() (*string, bool)`
|
||||
|
||||
GetProviderOk returns a tuple with the Provider field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetProvider
|
||||
|
||||
`func (o *WireGuardRelay) SetProvider(v string)`
|
||||
|
||||
SetProvider sets Provider field to given value.
|
||||
|
||||
### HasProvider
|
||||
|
||||
`func (o *WireGuardRelay) HasProvider() bool`
|
||||
|
||||
HasProvider returns a boolean if a field has been set.
|
||||
|
||||
### GetIpv4AddrIn
|
||||
|
||||
`func (o *WireGuardRelay) GetIpv4AddrIn() string`
|
||||
|
||||
GetIpv4AddrIn returns the Ipv4AddrIn field if non-nil, zero value otherwise.
|
||||
|
||||
### GetIpv4AddrInOk
|
||||
|
||||
`func (o *WireGuardRelay) GetIpv4AddrInOk() (*string, bool)`
|
||||
|
||||
GetIpv4AddrInOk returns a tuple with the Ipv4AddrIn field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetIpv4AddrIn
|
||||
|
||||
`func (o *WireGuardRelay) SetIpv4AddrIn(v string)`
|
||||
|
||||
SetIpv4AddrIn sets Ipv4AddrIn field to given value.
|
||||
|
||||
### HasIpv4AddrIn
|
||||
|
||||
`func (o *WireGuardRelay) HasIpv4AddrIn() bool`
|
||||
|
||||
HasIpv4AddrIn returns a boolean if a field has been set.
|
||||
|
||||
### GetIncludeInCountry
|
||||
|
||||
`func (o *WireGuardRelay) GetIncludeInCountry() bool`
|
||||
|
||||
GetIncludeInCountry returns the IncludeInCountry field if non-nil, zero value otherwise.
|
||||
|
||||
### GetIncludeInCountryOk
|
||||
|
||||
`func (o *WireGuardRelay) GetIncludeInCountryOk() (*bool, bool)`
|
||||
|
||||
GetIncludeInCountryOk returns a tuple with the IncludeInCountry field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetIncludeInCountry
|
||||
|
||||
`func (o *WireGuardRelay) SetIncludeInCountry(v bool)`
|
||||
|
||||
SetIncludeInCountry sets IncludeInCountry field to given value.
|
||||
|
||||
### HasIncludeInCountry
|
||||
|
||||
`func (o *WireGuardRelay) HasIncludeInCountry() bool`
|
||||
|
||||
HasIncludeInCountry returns a boolean if a field has been set.
|
||||
|
||||
### GetWeight
|
||||
|
||||
`func (o *WireGuardRelay) GetWeight() int32`
|
||||
|
||||
GetWeight returns the Weight field if non-nil, zero value otherwise.
|
||||
|
||||
### GetWeightOk
|
||||
|
||||
`func (o *WireGuardRelay) GetWeightOk() (*int32, bool)`
|
||||
|
||||
GetWeightOk returns a tuple with the Weight field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetWeight
|
||||
|
||||
`func (o *WireGuardRelay) SetWeight(v int32)`
|
||||
|
||||
SetWeight sets Weight field to given value.
|
||||
|
||||
### HasWeight
|
||||
|
||||
`func (o *WireGuardRelay) HasWeight() bool`
|
||||
|
||||
HasWeight returns a boolean if a field has been set.
|
||||
|
||||
### GetPublicKey
|
||||
|
||||
`func (o *WireGuardRelay) GetPublicKey() string`
|
||||
|
||||
GetPublicKey returns the PublicKey field if non-nil, zero value otherwise.
|
||||
|
||||
### GetPublicKeyOk
|
||||
|
||||
`func (o *WireGuardRelay) 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 *WireGuardRelay) SetPublicKey(v string)`
|
||||
|
||||
SetPublicKey sets PublicKey field to given value.
|
||||
|
||||
### HasPublicKey
|
||||
|
||||
`func (o *WireGuardRelay) HasPublicKey() bool`
|
||||
|
||||
HasPublicKey returns a boolean if a field has been set.
|
||||
|
||||
### GetIpv6AddrIn
|
||||
|
||||
`func (o *WireGuardRelay) GetIpv6AddrIn() string`
|
||||
|
||||
GetIpv6AddrIn returns the Ipv6AddrIn field if non-nil, zero value otherwise.
|
||||
|
||||
### GetIpv6AddrInOk
|
||||
|
||||
`func (o *WireGuardRelay) GetIpv6AddrInOk() (*string, bool)`
|
||||
|
||||
GetIpv6AddrInOk returns a tuple with the Ipv6AddrIn field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetIpv6AddrIn
|
||||
|
||||
`func (o *WireGuardRelay) SetIpv6AddrIn(v string)`
|
||||
|
||||
SetIpv6AddrIn sets Ipv6AddrIn field to given value.
|
||||
|
||||
### HasIpv6AddrIn
|
||||
|
||||
`func (o *WireGuardRelay) HasIpv6AddrIn() bool`
|
||||
|
||||
HasIpv6AddrIn returns a boolean if a field has been set.
|
||||
|
||||
### GetSameIp
|
||||
|
||||
`func (o *WireGuardRelay) GetSameIp() bool`
|
||||
|
||||
GetSameIp returns the SameIp field if non-nil, zero value otherwise.
|
||||
|
||||
### GetSameIpOk
|
||||
|
||||
`func (o *WireGuardRelay) GetSameIpOk() (*bool, bool)`
|
||||
|
||||
GetSameIpOk returns a tuple with the SameIp field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetSameIp
|
||||
|
||||
`func (o *WireGuardRelay) SetSameIp(v bool)`
|
||||
|
||||
SetSameIp sets SameIp field to given value.
|
||||
|
||||
### HasSameIp
|
||||
|
||||
`func (o *WireGuardRelay) HasSameIp() bool`
|
||||
|
||||
HasSameIp returns a boolean if a field has been set.
|
||||
|
||||
### GetDaita
|
||||
|
||||
`func (o *WireGuardRelay) GetDaita() bool`
|
||||
|
||||
GetDaita returns the Daita field if non-nil, zero value otherwise.
|
||||
|
||||
### GetDaitaOk
|
||||
|
||||
`func (o *WireGuardRelay) GetDaitaOk() (*bool, bool)`
|
||||
|
||||
GetDaitaOk returns a tuple with the Daita field if it's non-nil, zero value otherwise
|
||||
and a boolean to check if the value has been set.
|
||||
|
||||
### SetDaita
|
||||
|
||||
`func (o *WireGuardRelay) SetDaita(v bool)`
|
||||
|
||||
SetDaita sets Daita field to given value.
|
||||
|
||||
### HasDaita
|
||||
|
||||
`func (o *WireGuardRelay) HasDaita() bool`
|
||||
|
||||
HasDaita 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)
|
||||
|
||||
|
159
pkg/mullvad_api/model__v1_create_apple_payment_post_request.go
Normal file
159
pkg/mullvad_api/model__v1_create_apple_payment_post_request.go
Normal file
@ -0,0 +1,159 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"bytes"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// checks if the V1CreateApplePaymentPostRequest type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &V1CreateApplePaymentPostRequest{}
|
||||
|
||||
// V1CreateApplePaymentPostRequest struct for V1CreateApplePaymentPostRequest
|
||||
type V1CreateApplePaymentPostRequest struct {
|
||||
// An encrypted Base64-encoded App Store receipt
|
||||
ReceiptString string `json:"receipt_string"`
|
||||
}
|
||||
|
||||
type _V1CreateApplePaymentPostRequest V1CreateApplePaymentPostRequest
|
||||
|
||||
// NewV1CreateApplePaymentPostRequest instantiates a new V1CreateApplePaymentPostRequest 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 NewV1CreateApplePaymentPostRequest(receiptString string) *V1CreateApplePaymentPostRequest {
|
||||
this := V1CreateApplePaymentPostRequest{}
|
||||
this.ReceiptString = receiptString
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewV1CreateApplePaymentPostRequestWithDefaults instantiates a new V1CreateApplePaymentPostRequest 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 NewV1CreateApplePaymentPostRequestWithDefaults() *V1CreateApplePaymentPostRequest {
|
||||
this := V1CreateApplePaymentPostRequest{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetReceiptString returns the ReceiptString field value
|
||||
func (o *V1CreateApplePaymentPostRequest) GetReceiptString() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.ReceiptString
|
||||
}
|
||||
|
||||
// GetReceiptStringOk returns a tuple with the ReceiptString field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1CreateApplePaymentPostRequest) GetReceiptStringOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.ReceiptString, true
|
||||
}
|
||||
|
||||
// SetReceiptString sets field value
|
||||
func (o *V1CreateApplePaymentPostRequest) SetReceiptString(v string) {
|
||||
o.ReceiptString = v
|
||||
}
|
||||
|
||||
func (o V1CreateApplePaymentPostRequest) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o V1CreateApplePaymentPostRequest) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
toSerialize["receipt_string"] = o.ReceiptString
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *V1CreateApplePaymentPostRequest) 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{
|
||||
"receipt_string",
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
varV1CreateApplePaymentPostRequest := _V1CreateApplePaymentPostRequest{}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
err = decoder.Decode(&varV1CreateApplePaymentPostRequest)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = V1CreateApplePaymentPostRequest(varV1CreateApplePaymentPostRequest)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableV1CreateApplePaymentPostRequest struct {
|
||||
value *V1CreateApplePaymentPostRequest
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableV1CreateApplePaymentPostRequest) Get() *V1CreateApplePaymentPostRequest {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableV1CreateApplePaymentPostRequest) Set(val *V1CreateApplePaymentPostRequest) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableV1CreateApplePaymentPostRequest) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableV1CreateApplePaymentPostRequest) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableV1CreateApplePaymentPostRequest(val *V1CreateApplePaymentPostRequest) *NullableV1CreateApplePaymentPostRequest {
|
||||
return &NullableV1CreateApplePaymentPostRequest{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableV1CreateApplePaymentPostRequest) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableV1CreateApplePaymentPostRequest) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
162
pkg/mullvad_api/model__v1_me_get_200_response.go
Normal file
162
pkg/mullvad_api/model__v1_me_get_200_response.go
Normal file
@ -0,0 +1,162 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the V1MeGet200Response type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &V1MeGet200Response{}
|
||||
|
||||
// V1MeGet200Response struct for V1MeGet200Response
|
||||
type V1MeGet200Response struct {
|
||||
Token *string `json:"token,omitempty"`
|
||||
Expires *string `json:"expires,omitempty"`
|
||||
}
|
||||
|
||||
// NewV1MeGet200Response instantiates a new V1MeGet200Response 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 NewV1MeGet200Response() *V1MeGet200Response {
|
||||
this := V1MeGet200Response{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewV1MeGet200ResponseWithDefaults instantiates a new V1MeGet200Response 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 NewV1MeGet200ResponseWithDefaults() *V1MeGet200Response {
|
||||
this := V1MeGet200Response{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetToken returns the Token field value if set, zero value otherwise.
|
||||
func (o *V1MeGet200Response) GetToken() string {
|
||||
if o == nil || IsNil(o.Token) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Token
|
||||
}
|
||||
|
||||
// GetTokenOk returns a tuple with the Token field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1MeGet200Response) GetTokenOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Token) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Token, true
|
||||
}
|
||||
|
||||
// HasToken returns a boolean if a field has been set.
|
||||
func (o *V1MeGet200Response) HasToken() bool {
|
||||
if o != nil && !IsNil(o.Token) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetToken gets a reference to the given string and assigns it to the Token field.
|
||||
func (o *V1MeGet200Response) SetToken(v string) {
|
||||
o.Token = &v
|
||||
}
|
||||
|
||||
// GetExpires returns the Expires field value if set, zero value otherwise.
|
||||
func (o *V1MeGet200Response) GetExpires() string {
|
||||
if o == nil || IsNil(o.Expires) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Expires
|
||||
}
|
||||
|
||||
// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1MeGet200Response) GetExpiresOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Expires) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Expires, true
|
||||
}
|
||||
|
||||
// HasExpires returns a boolean if a field has been set.
|
||||
func (o *V1MeGet200Response) HasExpires() bool {
|
||||
if o != nil && !IsNil(o.Expires) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetExpires gets a reference to the given string and assigns it to the Expires field.
|
||||
func (o *V1MeGet200Response) SetExpires(v string) {
|
||||
o.Expires = &v
|
||||
}
|
||||
|
||||
func (o V1MeGet200Response) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o V1MeGet200Response) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Token) {
|
||||
toSerialize["token"] = o.Token
|
||||
}
|
||||
if !IsNil(o.Expires) {
|
||||
toSerialize["expires"] = o.Expires
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableV1MeGet200Response struct {
|
||||
value *V1MeGet200Response
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableV1MeGet200Response) Get() *V1MeGet200Response {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableV1MeGet200Response) Set(val *V1MeGet200Response) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableV1MeGet200Response) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableV1MeGet200Response) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableV1MeGet200Response(val *V1MeGet200Response) *NullableV1MeGet200Response {
|
||||
return &NullableV1MeGet200Response{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableV1MeGet200Response) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableV1MeGet200Response) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
258
pkg/mullvad_api/model__v1_problem_report_post_request.go
Normal file
258
pkg/mullvad_api/model__v1_problem_report_post_request.go
Normal file
@ -0,0 +1,258 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"bytes"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// checks if the V1ProblemReportPostRequest type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &V1ProblemReportPostRequest{}
|
||||
|
||||
// V1ProblemReportPostRequest struct for V1ProblemReportPostRequest
|
||||
type V1ProblemReportPostRequest struct {
|
||||
Address *string `json:"address,omitempty"`
|
||||
Message *string `json:"message,omitempty"`
|
||||
Log string `json:"log"`
|
||||
Metadata map[string]interface{} `json:"metadata"`
|
||||
}
|
||||
|
||||
type _V1ProblemReportPostRequest V1ProblemReportPostRequest
|
||||
|
||||
// NewV1ProblemReportPostRequest instantiates a new V1ProblemReportPostRequest 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 NewV1ProblemReportPostRequest(log string, metadata map[string]interface{}) *V1ProblemReportPostRequest {
|
||||
this := V1ProblemReportPostRequest{}
|
||||
this.Log = log
|
||||
this.Metadata = metadata
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewV1ProblemReportPostRequestWithDefaults instantiates a new V1ProblemReportPostRequest 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 NewV1ProblemReportPostRequestWithDefaults() *V1ProblemReportPostRequest {
|
||||
this := V1ProblemReportPostRequest{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetAddress returns the Address field value if set, zero value otherwise.
|
||||
func (o *V1ProblemReportPostRequest) GetAddress() string {
|
||||
if o == nil || IsNil(o.Address) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Address
|
||||
}
|
||||
|
||||
// GetAddressOk returns a tuple with the Address field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1ProblemReportPostRequest) GetAddressOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Address) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Address, true
|
||||
}
|
||||
|
||||
// HasAddress returns a boolean if a field has been set.
|
||||
func (o *V1ProblemReportPostRequest) HasAddress() bool {
|
||||
if o != nil && !IsNil(o.Address) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetAddress gets a reference to the given string and assigns it to the Address field.
|
||||
func (o *V1ProblemReportPostRequest) SetAddress(v string) {
|
||||
o.Address = &v
|
||||
}
|
||||
|
||||
// GetMessage returns the Message field value if set, zero value otherwise.
|
||||
func (o *V1ProblemReportPostRequest) GetMessage() string {
|
||||
if o == nil || IsNil(o.Message) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Message
|
||||
}
|
||||
|
||||
// GetMessageOk returns a tuple with the Message field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1ProblemReportPostRequest) GetMessageOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Message) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Message, true
|
||||
}
|
||||
|
||||
// HasMessage returns a boolean if a field has been set.
|
||||
func (o *V1ProblemReportPostRequest) HasMessage() bool {
|
||||
if o != nil && !IsNil(o.Message) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetMessage gets a reference to the given string and assigns it to the Message field.
|
||||
func (o *V1ProblemReportPostRequest) SetMessage(v string) {
|
||||
o.Message = &v
|
||||
}
|
||||
|
||||
// GetLog returns the Log field value
|
||||
func (o *V1ProblemReportPostRequest) GetLog() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Log
|
||||
}
|
||||
|
||||
// GetLogOk returns a tuple with the Log field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1ProblemReportPostRequest) GetLogOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Log, true
|
||||
}
|
||||
|
||||
// SetLog sets field value
|
||||
func (o *V1ProblemReportPostRequest) SetLog(v string) {
|
||||
o.Log = v
|
||||
}
|
||||
|
||||
// GetMetadata returns the Metadata field value
|
||||
func (o *V1ProblemReportPostRequest) GetMetadata() map[string]interface{} {
|
||||
if o == nil {
|
||||
var ret map[string]interface{}
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Metadata
|
||||
}
|
||||
|
||||
// GetMetadataOk returns a tuple with the Metadata field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1ProblemReportPostRequest) GetMetadataOk() (map[string]interface{}, bool) {
|
||||
if o == nil {
|
||||
return map[string]interface{}{}, false
|
||||
}
|
||||
return o.Metadata, true
|
||||
}
|
||||
|
||||
// SetMetadata sets field value
|
||||
func (o *V1ProblemReportPostRequest) SetMetadata(v map[string]interface{}) {
|
||||
o.Metadata = v
|
||||
}
|
||||
|
||||
func (o V1ProblemReportPostRequest) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o V1ProblemReportPostRequest) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Address) {
|
||||
toSerialize["address"] = o.Address
|
||||
}
|
||||
if !IsNil(o.Message) {
|
||||
toSerialize["message"] = o.Message
|
||||
}
|
||||
toSerialize["log"] = o.Log
|
||||
toSerialize["metadata"] = o.Metadata
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *V1ProblemReportPostRequest) 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{
|
||||
"log",
|
||||
"metadata",
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
varV1ProblemReportPostRequest := _V1ProblemReportPostRequest{}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
err = decoder.Decode(&varV1ProblemReportPostRequest)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = V1ProblemReportPostRequest(varV1ProblemReportPostRequest)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableV1ProblemReportPostRequest struct {
|
||||
value *V1ProblemReportPostRequest
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableV1ProblemReportPostRequest) Get() *V1ProblemReportPostRequest {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableV1ProblemReportPostRequest) Set(val *V1ProblemReportPostRequest) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableV1ProblemReportPostRequest) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableV1ProblemReportPostRequest) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableV1ProblemReportPostRequest(val *V1ProblemReportPostRequest) *NullableV1ProblemReportPostRequest {
|
||||
return &NullableV1ProblemReportPostRequest{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableV1ProblemReportPostRequest) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableV1ProblemReportPostRequest) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
234
pkg/mullvad_api/model__v1_relays_get_200_response.go
Normal file
234
pkg/mullvad_api/model__v1_relays_get_200_response.go
Normal file
@ -0,0 +1,234 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the V1RelaysGet200Response type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &V1RelaysGet200Response{}
|
||||
|
||||
// V1RelaysGet200Response struct for V1RelaysGet200Response
|
||||
type V1RelaysGet200Response struct {
|
||||
Locations *map[string]Location `json:"locations,omitempty"`
|
||||
Openvpn *V1RelaysGet200ResponseOpenvpn `json:"openvpn,omitempty"`
|
||||
Wireguard *V1RelaysGet200ResponseWireguard `json:"wireguard,omitempty"`
|
||||
Bridge *V1RelaysGet200ResponseBridge `json:"bridge,omitempty"`
|
||||
}
|
||||
|
||||
// NewV1RelaysGet200Response instantiates a new V1RelaysGet200Response 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 NewV1RelaysGet200Response() *V1RelaysGet200Response {
|
||||
this := V1RelaysGet200Response{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewV1RelaysGet200ResponseWithDefaults instantiates a new V1RelaysGet200Response 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 NewV1RelaysGet200ResponseWithDefaults() *V1RelaysGet200Response {
|
||||
this := V1RelaysGet200Response{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetLocations returns the Locations field value if set, zero value otherwise.
|
||||
func (o *V1RelaysGet200Response) GetLocations() map[string]Location {
|
||||
if o == nil || IsNil(o.Locations) {
|
||||
var ret map[string]Location
|
||||
return ret
|
||||
}
|
||||
return *o.Locations
|
||||
}
|
||||
|
||||
// GetLocationsOk returns a tuple with the Locations field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1RelaysGet200Response) GetLocationsOk() (*map[string]Location, bool) {
|
||||
if o == nil || IsNil(o.Locations) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Locations, true
|
||||
}
|
||||
|
||||
// HasLocations returns a boolean if a field has been set.
|
||||
func (o *V1RelaysGet200Response) HasLocations() bool {
|
||||
if o != nil && !IsNil(o.Locations) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLocations gets a reference to the given map[string]Location and assigns it to the Locations field.
|
||||
func (o *V1RelaysGet200Response) SetLocations(v map[string]Location) {
|
||||
o.Locations = &v
|
||||
}
|
||||
|
||||
// GetOpenvpn returns the Openvpn field value if set, zero value otherwise.
|
||||
func (o *V1RelaysGet200Response) GetOpenvpn() V1RelaysGet200ResponseOpenvpn {
|
||||
if o == nil || IsNil(o.Openvpn) {
|
||||
var ret V1RelaysGet200ResponseOpenvpn
|
||||
return ret
|
||||
}
|
||||
return *o.Openvpn
|
||||
}
|
||||
|
||||
// GetOpenvpnOk returns a tuple with the Openvpn field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1RelaysGet200Response) GetOpenvpnOk() (*V1RelaysGet200ResponseOpenvpn, bool) {
|
||||
if o == nil || IsNil(o.Openvpn) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Openvpn, true
|
||||
}
|
||||
|
||||
// HasOpenvpn returns a boolean if a field has been set.
|
||||
func (o *V1RelaysGet200Response) HasOpenvpn() bool {
|
||||
if o != nil && !IsNil(o.Openvpn) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOpenvpn gets a reference to the given V1RelaysGet200ResponseOpenvpn and assigns it to the Openvpn field.
|
||||
func (o *V1RelaysGet200Response) SetOpenvpn(v V1RelaysGet200ResponseOpenvpn) {
|
||||
o.Openvpn = &v
|
||||
}
|
||||
|
||||
// GetWireguard returns the Wireguard field value if set, zero value otherwise.
|
||||
func (o *V1RelaysGet200Response) GetWireguard() V1RelaysGet200ResponseWireguard {
|
||||
if o == nil || IsNil(o.Wireguard) {
|
||||
var ret V1RelaysGet200ResponseWireguard
|
||||
return ret
|
||||
}
|
||||
return *o.Wireguard
|
||||
}
|
||||
|
||||
// GetWireguardOk returns a tuple with the Wireguard field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1RelaysGet200Response) GetWireguardOk() (*V1RelaysGet200ResponseWireguard, bool) {
|
||||
if o == nil || IsNil(o.Wireguard) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Wireguard, true
|
||||
}
|
||||
|
||||
// HasWireguard returns a boolean if a field has been set.
|
||||
func (o *V1RelaysGet200Response) HasWireguard() bool {
|
||||
if o != nil && !IsNil(o.Wireguard) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetWireguard gets a reference to the given V1RelaysGet200ResponseWireguard and assigns it to the Wireguard field.
|
||||
func (o *V1RelaysGet200Response) SetWireguard(v V1RelaysGet200ResponseWireguard) {
|
||||
o.Wireguard = &v
|
||||
}
|
||||
|
||||
// GetBridge returns the Bridge field value if set, zero value otherwise.
|
||||
func (o *V1RelaysGet200Response) GetBridge() V1RelaysGet200ResponseBridge {
|
||||
if o == nil || IsNil(o.Bridge) {
|
||||
var ret V1RelaysGet200ResponseBridge
|
||||
return ret
|
||||
}
|
||||
return *o.Bridge
|
||||
}
|
||||
|
||||
// GetBridgeOk returns a tuple with the Bridge field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1RelaysGet200Response) GetBridgeOk() (*V1RelaysGet200ResponseBridge, bool) {
|
||||
if o == nil || IsNil(o.Bridge) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Bridge, true
|
||||
}
|
||||
|
||||
// HasBridge returns a boolean if a field has been set.
|
||||
func (o *V1RelaysGet200Response) HasBridge() bool {
|
||||
if o != nil && !IsNil(o.Bridge) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetBridge gets a reference to the given V1RelaysGet200ResponseBridge and assigns it to the Bridge field.
|
||||
func (o *V1RelaysGet200Response) SetBridge(v V1RelaysGet200ResponseBridge) {
|
||||
o.Bridge = &v
|
||||
}
|
||||
|
||||
func (o V1RelaysGet200Response) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o V1RelaysGet200Response) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Locations) {
|
||||
toSerialize["locations"] = o.Locations
|
||||
}
|
||||
if !IsNil(o.Openvpn) {
|
||||
toSerialize["openvpn"] = o.Openvpn
|
||||
}
|
||||
if !IsNil(o.Wireguard) {
|
||||
toSerialize["wireguard"] = o.Wireguard
|
||||
}
|
||||
if !IsNil(o.Bridge) {
|
||||
toSerialize["bridge"] = o.Bridge
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableV1RelaysGet200Response struct {
|
||||
value *V1RelaysGet200Response
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableV1RelaysGet200Response) Get() *V1RelaysGet200Response {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableV1RelaysGet200Response) Set(val *V1RelaysGet200Response) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableV1RelaysGet200Response) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableV1RelaysGet200Response) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableV1RelaysGet200Response(val *V1RelaysGet200Response) *NullableV1RelaysGet200Response {
|
||||
return &NullableV1RelaysGet200Response{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableV1RelaysGet200Response) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableV1RelaysGet200Response) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
163
pkg/mullvad_api/model__v1_relays_get_200_response_bridge.go
Normal file
163
pkg/mullvad_api/model__v1_relays_get_200_response_bridge.go
Normal file
@ -0,0 +1,163 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the V1RelaysGet200ResponseBridge type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &V1RelaysGet200ResponseBridge{}
|
||||
|
||||
// V1RelaysGet200ResponseBridge struct for V1RelaysGet200ResponseBridge
|
||||
type V1RelaysGet200ResponseBridge struct {
|
||||
// List of connection specs for Shadowsocks ports
|
||||
Shadowsocks []V1RelaysGet200ResponseBridgeShadowsocksInner `json:"shadowsocks,omitempty"`
|
||||
Relays []BridgeRelay `json:"relays,omitempty"`
|
||||
}
|
||||
|
||||
// NewV1RelaysGet200ResponseBridge instantiates a new V1RelaysGet200ResponseBridge 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 NewV1RelaysGet200ResponseBridge() *V1RelaysGet200ResponseBridge {
|
||||
this := V1RelaysGet200ResponseBridge{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewV1RelaysGet200ResponseBridgeWithDefaults instantiates a new V1RelaysGet200ResponseBridge 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 NewV1RelaysGet200ResponseBridgeWithDefaults() *V1RelaysGet200ResponseBridge {
|
||||
this := V1RelaysGet200ResponseBridge{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetShadowsocks returns the Shadowsocks field value if set, zero value otherwise.
|
||||
func (o *V1RelaysGet200ResponseBridge) GetShadowsocks() []V1RelaysGet200ResponseBridgeShadowsocksInner {
|
||||
if o == nil || IsNil(o.Shadowsocks) {
|
||||
var ret []V1RelaysGet200ResponseBridgeShadowsocksInner
|
||||
return ret
|
||||
}
|
||||
return o.Shadowsocks
|
||||
}
|
||||
|
||||
// GetShadowsocksOk returns a tuple with the Shadowsocks field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1RelaysGet200ResponseBridge) GetShadowsocksOk() ([]V1RelaysGet200ResponseBridgeShadowsocksInner, bool) {
|
||||
if o == nil || IsNil(o.Shadowsocks) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Shadowsocks, true
|
||||
}
|
||||
|
||||
// HasShadowsocks returns a boolean if a field has been set.
|
||||
func (o *V1RelaysGet200ResponseBridge) HasShadowsocks() bool {
|
||||
if o != nil && !IsNil(o.Shadowsocks) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetShadowsocks gets a reference to the given []V1RelaysGet200ResponseBridgeShadowsocksInner and assigns it to the Shadowsocks field.
|
||||
func (o *V1RelaysGet200ResponseBridge) SetShadowsocks(v []V1RelaysGet200ResponseBridgeShadowsocksInner) {
|
||||
o.Shadowsocks = v
|
||||
}
|
||||
|
||||
// GetRelays returns the Relays field value if set, zero value otherwise.
|
||||
func (o *V1RelaysGet200ResponseBridge) GetRelays() []BridgeRelay {
|
||||
if o == nil || IsNil(o.Relays) {
|
||||
var ret []BridgeRelay
|
||||
return ret
|
||||
}
|
||||
return o.Relays
|
||||
}
|
||||
|
||||
// GetRelaysOk returns a tuple with the Relays field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1RelaysGet200ResponseBridge) GetRelaysOk() ([]BridgeRelay, bool) {
|
||||
if o == nil || IsNil(o.Relays) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Relays, true
|
||||
}
|
||||
|
||||
// HasRelays returns a boolean if a field has been set.
|
||||
func (o *V1RelaysGet200ResponseBridge) HasRelays() bool {
|
||||
if o != nil && !IsNil(o.Relays) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetRelays gets a reference to the given []BridgeRelay and assigns it to the Relays field.
|
||||
func (o *V1RelaysGet200ResponseBridge) SetRelays(v []BridgeRelay) {
|
||||
o.Relays = v
|
||||
}
|
||||
|
||||
func (o V1RelaysGet200ResponseBridge) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o V1RelaysGet200ResponseBridge) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Shadowsocks) {
|
||||
toSerialize["shadowsocks"] = o.Shadowsocks
|
||||
}
|
||||
if !IsNil(o.Relays) {
|
||||
toSerialize["relays"] = o.Relays
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableV1RelaysGet200ResponseBridge struct {
|
||||
value *V1RelaysGet200ResponseBridge
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableV1RelaysGet200ResponseBridge) Get() *V1RelaysGet200ResponseBridge {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableV1RelaysGet200ResponseBridge) Set(val *V1RelaysGet200ResponseBridge) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableV1RelaysGet200ResponseBridge) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableV1RelaysGet200ResponseBridge) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableV1RelaysGet200ResponseBridge(val *V1RelaysGet200ResponseBridge) *NullableV1RelaysGet200ResponseBridge {
|
||||
return &NullableV1RelaysGet200ResponseBridge{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableV1RelaysGet200ResponseBridge) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableV1RelaysGet200ResponseBridge) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,234 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the V1RelaysGet200ResponseBridgeShadowsocksInner type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &V1RelaysGet200ResponseBridgeShadowsocksInner{}
|
||||
|
||||
// V1RelaysGet200ResponseBridgeShadowsocksInner struct for V1RelaysGet200ResponseBridgeShadowsocksInner
|
||||
type V1RelaysGet200ResponseBridgeShadowsocksInner struct {
|
||||
Protocol *string `json:"protocol,omitempty"`
|
||||
Port *int32 `json:"port,omitempty"`
|
||||
Cipher *string `json:"cipher,omitempty"`
|
||||
Password *string `json:"password,omitempty"`
|
||||
}
|
||||
|
||||
// NewV1RelaysGet200ResponseBridgeShadowsocksInner instantiates a new V1RelaysGet200ResponseBridgeShadowsocksInner 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 NewV1RelaysGet200ResponseBridgeShadowsocksInner() *V1RelaysGet200ResponseBridgeShadowsocksInner {
|
||||
this := V1RelaysGet200ResponseBridgeShadowsocksInner{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewV1RelaysGet200ResponseBridgeShadowsocksInnerWithDefaults instantiates a new V1RelaysGet200ResponseBridgeShadowsocksInner 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 NewV1RelaysGet200ResponseBridgeShadowsocksInnerWithDefaults() *V1RelaysGet200ResponseBridgeShadowsocksInner {
|
||||
this := V1RelaysGet200ResponseBridgeShadowsocksInner{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetProtocol returns the Protocol field value if set, zero value otherwise.
|
||||
func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) GetProtocol() string {
|
||||
if o == nil || IsNil(o.Protocol) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Protocol
|
||||
}
|
||||
|
||||
// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) GetProtocolOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Protocol) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Protocol, true
|
||||
}
|
||||
|
||||
// HasProtocol returns a boolean if a field has been set.
|
||||
func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) HasProtocol() bool {
|
||||
if o != nil && !IsNil(o.Protocol) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetProtocol gets a reference to the given string and assigns it to the Protocol field.
|
||||
func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) SetProtocol(v string) {
|
||||
o.Protocol = &v
|
||||
}
|
||||
|
||||
// GetPort returns the Port field value if set, zero value otherwise.
|
||||
func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) GetPort() int32 {
|
||||
if o == nil || IsNil(o.Port) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.Port
|
||||
}
|
||||
|
||||
// GetPortOk returns a tuple with the Port field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) GetPortOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.Port) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Port, true
|
||||
}
|
||||
|
||||
// HasPort returns a boolean if a field has been set.
|
||||
func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) HasPort() bool {
|
||||
if o != nil && !IsNil(o.Port) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPort gets a reference to the given int32 and assigns it to the Port field.
|
||||
func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) SetPort(v int32) {
|
||||
o.Port = &v
|
||||
}
|
||||
|
||||
// GetCipher returns the Cipher field value if set, zero value otherwise.
|
||||
func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) GetCipher() string {
|
||||
if o == nil || IsNil(o.Cipher) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Cipher
|
||||
}
|
||||
|
||||
// GetCipherOk returns a tuple with the Cipher field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) GetCipherOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Cipher) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Cipher, true
|
||||
}
|
||||
|
||||
// HasCipher returns a boolean if a field has been set.
|
||||
func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) HasCipher() bool {
|
||||
if o != nil && !IsNil(o.Cipher) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetCipher gets a reference to the given string and assigns it to the Cipher field.
|
||||
func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) SetCipher(v string) {
|
||||
o.Cipher = &v
|
||||
}
|
||||
|
||||
// GetPassword returns the Password field value if set, zero value otherwise.
|
||||
func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) GetPassword() string {
|
||||
if o == nil || IsNil(o.Password) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Password
|
||||
}
|
||||
|
||||
// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) GetPasswordOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Password) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Password, true
|
||||
}
|
||||
|
||||
// HasPassword returns a boolean if a field has been set.
|
||||
func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) HasPassword() bool {
|
||||
if o != nil && !IsNil(o.Password) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPassword gets a reference to the given string and assigns it to the Password field.
|
||||
func (o *V1RelaysGet200ResponseBridgeShadowsocksInner) SetPassword(v string) {
|
||||
o.Password = &v
|
||||
}
|
||||
|
||||
func (o V1RelaysGet200ResponseBridgeShadowsocksInner) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o V1RelaysGet200ResponseBridgeShadowsocksInner) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Protocol) {
|
||||
toSerialize["protocol"] = o.Protocol
|
||||
}
|
||||
if !IsNil(o.Port) {
|
||||
toSerialize["port"] = o.Port
|
||||
}
|
||||
if !IsNil(o.Cipher) {
|
||||
toSerialize["cipher"] = o.Cipher
|
||||
}
|
||||
if !IsNil(o.Password) {
|
||||
toSerialize["password"] = o.Password
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableV1RelaysGet200ResponseBridgeShadowsocksInner struct {
|
||||
value *V1RelaysGet200ResponseBridgeShadowsocksInner
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableV1RelaysGet200ResponseBridgeShadowsocksInner) Get() *V1RelaysGet200ResponseBridgeShadowsocksInner {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableV1RelaysGet200ResponseBridgeShadowsocksInner) Set(val *V1RelaysGet200ResponseBridgeShadowsocksInner) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableV1RelaysGet200ResponseBridgeShadowsocksInner) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableV1RelaysGet200ResponseBridgeShadowsocksInner) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableV1RelaysGet200ResponseBridgeShadowsocksInner(val *V1RelaysGet200ResponseBridgeShadowsocksInner) *NullableV1RelaysGet200ResponseBridgeShadowsocksInner {
|
||||
return &NullableV1RelaysGet200ResponseBridgeShadowsocksInner{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableV1RelaysGet200ResponseBridgeShadowsocksInner) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableV1RelaysGet200ResponseBridgeShadowsocksInner) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
163
pkg/mullvad_api/model__v1_relays_get_200_response_openvpn.go
Normal file
163
pkg/mullvad_api/model__v1_relays_get_200_response_openvpn.go
Normal file
@ -0,0 +1,163 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the V1RelaysGet200ResponseOpenvpn type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &V1RelaysGet200ResponseOpenvpn{}
|
||||
|
||||
// V1RelaysGet200ResponseOpenvpn struct for V1RelaysGet200ResponseOpenvpn
|
||||
type V1RelaysGet200ResponseOpenvpn struct {
|
||||
// Pairs of port/protocol that will accept connections
|
||||
Ports []V1RelaysGet200ResponseOpenvpnPortsInner `json:"ports,omitempty"`
|
||||
Relays []OpenVpnRelay `json:"relays,omitempty"`
|
||||
}
|
||||
|
||||
// NewV1RelaysGet200ResponseOpenvpn instantiates a new V1RelaysGet200ResponseOpenvpn 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 NewV1RelaysGet200ResponseOpenvpn() *V1RelaysGet200ResponseOpenvpn {
|
||||
this := V1RelaysGet200ResponseOpenvpn{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewV1RelaysGet200ResponseOpenvpnWithDefaults instantiates a new V1RelaysGet200ResponseOpenvpn 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 NewV1RelaysGet200ResponseOpenvpnWithDefaults() *V1RelaysGet200ResponseOpenvpn {
|
||||
this := V1RelaysGet200ResponseOpenvpn{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetPorts returns the Ports field value if set, zero value otherwise.
|
||||
func (o *V1RelaysGet200ResponseOpenvpn) GetPorts() []V1RelaysGet200ResponseOpenvpnPortsInner {
|
||||
if o == nil || IsNil(o.Ports) {
|
||||
var ret []V1RelaysGet200ResponseOpenvpnPortsInner
|
||||
return ret
|
||||
}
|
||||
return o.Ports
|
||||
}
|
||||
|
||||
// GetPortsOk returns a tuple with the Ports field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1RelaysGet200ResponseOpenvpn) GetPortsOk() ([]V1RelaysGet200ResponseOpenvpnPortsInner, bool) {
|
||||
if o == nil || IsNil(o.Ports) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Ports, true
|
||||
}
|
||||
|
||||
// HasPorts returns a boolean if a field has been set.
|
||||
func (o *V1RelaysGet200ResponseOpenvpn) HasPorts() bool {
|
||||
if o != nil && !IsNil(o.Ports) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPorts gets a reference to the given []V1RelaysGet200ResponseOpenvpnPortsInner and assigns it to the Ports field.
|
||||
func (o *V1RelaysGet200ResponseOpenvpn) SetPorts(v []V1RelaysGet200ResponseOpenvpnPortsInner) {
|
||||
o.Ports = v
|
||||
}
|
||||
|
||||
// GetRelays returns the Relays field value if set, zero value otherwise.
|
||||
func (o *V1RelaysGet200ResponseOpenvpn) GetRelays() []OpenVpnRelay {
|
||||
if o == nil || IsNil(o.Relays) {
|
||||
var ret []OpenVpnRelay
|
||||
return ret
|
||||
}
|
||||
return o.Relays
|
||||
}
|
||||
|
||||
// GetRelaysOk returns a tuple with the Relays field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1RelaysGet200ResponseOpenvpn) GetRelaysOk() ([]OpenVpnRelay, bool) {
|
||||
if o == nil || IsNil(o.Relays) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Relays, true
|
||||
}
|
||||
|
||||
// HasRelays returns a boolean if a field has been set.
|
||||
func (o *V1RelaysGet200ResponseOpenvpn) HasRelays() bool {
|
||||
if o != nil && !IsNil(o.Relays) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetRelays gets a reference to the given []OpenVpnRelay and assigns it to the Relays field.
|
||||
func (o *V1RelaysGet200ResponseOpenvpn) SetRelays(v []OpenVpnRelay) {
|
||||
o.Relays = v
|
||||
}
|
||||
|
||||
func (o V1RelaysGet200ResponseOpenvpn) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o V1RelaysGet200ResponseOpenvpn) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Ports) {
|
||||
toSerialize["ports"] = o.Ports
|
||||
}
|
||||
if !IsNil(o.Relays) {
|
||||
toSerialize["relays"] = o.Relays
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableV1RelaysGet200ResponseOpenvpn struct {
|
||||
value *V1RelaysGet200ResponseOpenvpn
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableV1RelaysGet200ResponseOpenvpn) Get() *V1RelaysGet200ResponseOpenvpn {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableV1RelaysGet200ResponseOpenvpn) Set(val *V1RelaysGet200ResponseOpenvpn) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableV1RelaysGet200ResponseOpenvpn) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableV1RelaysGet200ResponseOpenvpn) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableV1RelaysGet200ResponseOpenvpn(val *V1RelaysGet200ResponseOpenvpn) *NullableV1RelaysGet200ResponseOpenvpn {
|
||||
return &NullableV1RelaysGet200ResponseOpenvpn{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableV1RelaysGet200ResponseOpenvpn) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableV1RelaysGet200ResponseOpenvpn) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,162 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the V1RelaysGet200ResponseOpenvpnPortsInner type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &V1RelaysGet200ResponseOpenvpnPortsInner{}
|
||||
|
||||
// V1RelaysGet200ResponseOpenvpnPortsInner struct for V1RelaysGet200ResponseOpenvpnPortsInner
|
||||
type V1RelaysGet200ResponseOpenvpnPortsInner struct {
|
||||
Port *float32 `json:"port,omitempty"`
|
||||
Protocol *string `json:"protocol,omitempty"`
|
||||
}
|
||||
|
||||
// NewV1RelaysGet200ResponseOpenvpnPortsInner instantiates a new V1RelaysGet200ResponseOpenvpnPortsInner 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 NewV1RelaysGet200ResponseOpenvpnPortsInner() *V1RelaysGet200ResponseOpenvpnPortsInner {
|
||||
this := V1RelaysGet200ResponseOpenvpnPortsInner{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewV1RelaysGet200ResponseOpenvpnPortsInnerWithDefaults instantiates a new V1RelaysGet200ResponseOpenvpnPortsInner 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 NewV1RelaysGet200ResponseOpenvpnPortsInnerWithDefaults() *V1RelaysGet200ResponseOpenvpnPortsInner {
|
||||
this := V1RelaysGet200ResponseOpenvpnPortsInner{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetPort returns the Port field value if set, zero value otherwise.
|
||||
func (o *V1RelaysGet200ResponseOpenvpnPortsInner) GetPort() float32 {
|
||||
if o == nil || IsNil(o.Port) {
|
||||
var ret float32
|
||||
return ret
|
||||
}
|
||||
return *o.Port
|
||||
}
|
||||
|
||||
// GetPortOk returns a tuple with the Port field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1RelaysGet200ResponseOpenvpnPortsInner) GetPortOk() (*float32, bool) {
|
||||
if o == nil || IsNil(o.Port) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Port, true
|
||||
}
|
||||
|
||||
// HasPort returns a boolean if a field has been set.
|
||||
func (o *V1RelaysGet200ResponseOpenvpnPortsInner) HasPort() bool {
|
||||
if o != nil && !IsNil(o.Port) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPort gets a reference to the given float32 and assigns it to the Port field.
|
||||
func (o *V1RelaysGet200ResponseOpenvpnPortsInner) SetPort(v float32) {
|
||||
o.Port = &v
|
||||
}
|
||||
|
||||
// GetProtocol returns the Protocol field value if set, zero value otherwise.
|
||||
func (o *V1RelaysGet200ResponseOpenvpnPortsInner) GetProtocol() string {
|
||||
if o == nil || IsNil(o.Protocol) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Protocol
|
||||
}
|
||||
|
||||
// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1RelaysGet200ResponseOpenvpnPortsInner) GetProtocolOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Protocol) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Protocol, true
|
||||
}
|
||||
|
||||
// HasProtocol returns a boolean if a field has been set.
|
||||
func (o *V1RelaysGet200ResponseOpenvpnPortsInner) HasProtocol() bool {
|
||||
if o != nil && !IsNil(o.Protocol) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetProtocol gets a reference to the given string and assigns it to the Protocol field.
|
||||
func (o *V1RelaysGet200ResponseOpenvpnPortsInner) SetProtocol(v string) {
|
||||
o.Protocol = &v
|
||||
}
|
||||
|
||||
func (o V1RelaysGet200ResponseOpenvpnPortsInner) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o V1RelaysGet200ResponseOpenvpnPortsInner) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Port) {
|
||||
toSerialize["port"] = o.Port
|
||||
}
|
||||
if !IsNil(o.Protocol) {
|
||||
toSerialize["protocol"] = o.Protocol
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableV1RelaysGet200ResponseOpenvpnPortsInner struct {
|
||||
value *V1RelaysGet200ResponseOpenvpnPortsInner
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableV1RelaysGet200ResponseOpenvpnPortsInner) Get() *V1RelaysGet200ResponseOpenvpnPortsInner {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableV1RelaysGet200ResponseOpenvpnPortsInner) Set(val *V1RelaysGet200ResponseOpenvpnPortsInner) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableV1RelaysGet200ResponseOpenvpnPortsInner) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableV1RelaysGet200ResponseOpenvpnPortsInner) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableV1RelaysGet200ResponseOpenvpnPortsInner(val *V1RelaysGet200ResponseOpenvpnPortsInner) *NullableV1RelaysGet200ResponseOpenvpnPortsInner {
|
||||
return &NullableV1RelaysGet200ResponseOpenvpnPortsInner{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableV1RelaysGet200ResponseOpenvpnPortsInner) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableV1RelaysGet200ResponseOpenvpnPortsInner) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
237
pkg/mullvad_api/model__v1_relays_get_200_response_wireguard.go
Normal file
237
pkg/mullvad_api/model__v1_relays_get_200_response_wireguard.go
Normal file
@ -0,0 +1,237 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the V1RelaysGet200ResponseWireguard type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &V1RelaysGet200ResponseWireguard{}
|
||||
|
||||
// V1RelaysGet200ResponseWireguard struct for V1RelaysGet200ResponseWireguard
|
||||
type V1RelaysGet200ResponseWireguard struct {
|
||||
// List of port ranges that will accept connections
|
||||
PortRanges [][]int32 `json:"port_ranges,omitempty"`
|
||||
// The ipv4 gateway of the server, you can ping it to check whether a tunnel is connected or not.
|
||||
Ipv4Gateway *string `json:"ipv4_gateway,omitempty"`
|
||||
// The ipv6 gateway of the server, you can ping it to check whether a tunnel is connected or not.
|
||||
Ipv6Gateway *string `json:"ipv6_gateway,omitempty"`
|
||||
Relays []WireGuardRelay `json:"relays,omitempty"`
|
||||
}
|
||||
|
||||
// NewV1RelaysGet200ResponseWireguard instantiates a new V1RelaysGet200ResponseWireguard 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 NewV1RelaysGet200ResponseWireguard() *V1RelaysGet200ResponseWireguard {
|
||||
this := V1RelaysGet200ResponseWireguard{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewV1RelaysGet200ResponseWireguardWithDefaults instantiates a new V1RelaysGet200ResponseWireguard 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 NewV1RelaysGet200ResponseWireguardWithDefaults() *V1RelaysGet200ResponseWireguard {
|
||||
this := V1RelaysGet200ResponseWireguard{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetPortRanges returns the PortRanges field value if set, zero value otherwise.
|
||||
func (o *V1RelaysGet200ResponseWireguard) GetPortRanges() [][]int32 {
|
||||
if o == nil || IsNil(o.PortRanges) {
|
||||
var ret [][]int32
|
||||
return ret
|
||||
}
|
||||
return o.PortRanges
|
||||
}
|
||||
|
||||
// GetPortRangesOk returns a tuple with the PortRanges field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1RelaysGet200ResponseWireguard) GetPortRangesOk() ([][]int32, bool) {
|
||||
if o == nil || IsNil(o.PortRanges) {
|
||||
return nil, false
|
||||
}
|
||||
return o.PortRanges, true
|
||||
}
|
||||
|
||||
// HasPortRanges returns a boolean if a field has been set.
|
||||
func (o *V1RelaysGet200ResponseWireguard) HasPortRanges() bool {
|
||||
if o != nil && !IsNil(o.PortRanges) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPortRanges gets a reference to the given [][]int32 and assigns it to the PortRanges field.
|
||||
func (o *V1RelaysGet200ResponseWireguard) SetPortRanges(v [][]int32) {
|
||||
o.PortRanges = v
|
||||
}
|
||||
|
||||
// GetIpv4Gateway returns the Ipv4Gateway field value if set, zero value otherwise.
|
||||
func (o *V1RelaysGet200ResponseWireguard) GetIpv4Gateway() string {
|
||||
if o == nil || IsNil(o.Ipv4Gateway) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Ipv4Gateway
|
||||
}
|
||||
|
||||
// GetIpv4GatewayOk returns a tuple with the Ipv4Gateway field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1RelaysGet200ResponseWireguard) GetIpv4GatewayOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Ipv4Gateway) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Ipv4Gateway, true
|
||||
}
|
||||
|
||||
// HasIpv4Gateway returns a boolean if a field has been set.
|
||||
func (o *V1RelaysGet200ResponseWireguard) HasIpv4Gateway() bool {
|
||||
if o != nil && !IsNil(o.Ipv4Gateway) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetIpv4Gateway gets a reference to the given string and assigns it to the Ipv4Gateway field.
|
||||
func (o *V1RelaysGet200ResponseWireguard) SetIpv4Gateway(v string) {
|
||||
o.Ipv4Gateway = &v
|
||||
}
|
||||
|
||||
// GetIpv6Gateway returns the Ipv6Gateway field value if set, zero value otherwise.
|
||||
func (o *V1RelaysGet200ResponseWireguard) GetIpv6Gateway() string {
|
||||
if o == nil || IsNil(o.Ipv6Gateway) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Ipv6Gateway
|
||||
}
|
||||
|
||||
// GetIpv6GatewayOk returns a tuple with the Ipv6Gateway field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1RelaysGet200ResponseWireguard) GetIpv6GatewayOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Ipv6Gateway) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Ipv6Gateway, true
|
||||
}
|
||||
|
||||
// HasIpv6Gateway returns a boolean if a field has been set.
|
||||
func (o *V1RelaysGet200ResponseWireguard) HasIpv6Gateway() bool {
|
||||
if o != nil && !IsNil(o.Ipv6Gateway) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetIpv6Gateway gets a reference to the given string and assigns it to the Ipv6Gateway field.
|
||||
func (o *V1RelaysGet200ResponseWireguard) SetIpv6Gateway(v string) {
|
||||
o.Ipv6Gateway = &v
|
||||
}
|
||||
|
||||
// GetRelays returns the Relays field value if set, zero value otherwise.
|
||||
func (o *V1RelaysGet200ResponseWireguard) GetRelays() []WireGuardRelay {
|
||||
if o == nil || IsNil(o.Relays) {
|
||||
var ret []WireGuardRelay
|
||||
return ret
|
||||
}
|
||||
return o.Relays
|
||||
}
|
||||
|
||||
// GetRelaysOk returns a tuple with the Relays field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1RelaysGet200ResponseWireguard) GetRelaysOk() ([]WireGuardRelay, bool) {
|
||||
if o == nil || IsNil(o.Relays) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Relays, true
|
||||
}
|
||||
|
||||
// HasRelays returns a boolean if a field has been set.
|
||||
func (o *V1RelaysGet200ResponseWireguard) HasRelays() bool {
|
||||
if o != nil && !IsNil(o.Relays) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetRelays gets a reference to the given []WireGuardRelay and assigns it to the Relays field.
|
||||
func (o *V1RelaysGet200ResponseWireguard) SetRelays(v []WireGuardRelay) {
|
||||
o.Relays = v
|
||||
}
|
||||
|
||||
func (o V1RelaysGet200ResponseWireguard) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o V1RelaysGet200ResponseWireguard) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.PortRanges) {
|
||||
toSerialize["port_ranges"] = o.PortRanges
|
||||
}
|
||||
if !IsNil(o.Ipv4Gateway) {
|
||||
toSerialize["ipv4_gateway"] = o.Ipv4Gateway
|
||||
}
|
||||
if !IsNil(o.Ipv6Gateway) {
|
||||
toSerialize["ipv6_gateway"] = o.Ipv6Gateway
|
||||
}
|
||||
if !IsNil(o.Relays) {
|
||||
toSerialize["relays"] = o.Relays
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableV1RelaysGet200ResponseWireguard struct {
|
||||
value *V1RelaysGet200ResponseWireguard
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableV1RelaysGet200ResponseWireguard) Get() *V1RelaysGet200ResponseWireguard {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableV1RelaysGet200ResponseWireguard) Set(val *V1RelaysGet200ResponseWireguard) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableV1RelaysGet200ResponseWireguard) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableV1RelaysGet200ResponseWireguard) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableV1RelaysGet200ResponseWireguard(val *V1RelaysGet200ResponseWireguard) *NullableV1RelaysGet200ResponseWireguard {
|
||||
return &NullableV1RelaysGet200ResponseWireguard{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableV1RelaysGet200ResponseWireguard) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableV1RelaysGet200ResponseWireguard) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,264 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the V1ReleasesPlatformVersionGet200Response type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &V1ReleasesPlatformVersionGet200Response{}
|
||||
|
||||
// V1ReleasesPlatformVersionGet200Response struct for V1ReleasesPlatformVersionGet200Response
|
||||
type V1ReleasesPlatformVersionGet200Response struct {
|
||||
Supported *bool `json:"supported,omitempty"`
|
||||
Latest NullableString `json:"latest,omitempty"`
|
||||
LatestStable NullableString `json:"latest_stable,omitempty"`
|
||||
LatestBeta NullableString `json:"latest_beta,omitempty"`
|
||||
}
|
||||
|
||||
// NewV1ReleasesPlatformVersionGet200Response instantiates a new V1ReleasesPlatformVersionGet200Response 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 NewV1ReleasesPlatformVersionGet200Response() *V1ReleasesPlatformVersionGet200Response {
|
||||
this := V1ReleasesPlatformVersionGet200Response{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewV1ReleasesPlatformVersionGet200ResponseWithDefaults instantiates a new V1ReleasesPlatformVersionGet200Response 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 NewV1ReleasesPlatformVersionGet200ResponseWithDefaults() *V1ReleasesPlatformVersionGet200Response {
|
||||
this := V1ReleasesPlatformVersionGet200Response{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetSupported returns the Supported field value if set, zero value otherwise.
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) GetSupported() bool {
|
||||
if o == nil || IsNil(o.Supported) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.Supported
|
||||
}
|
||||
|
||||
// GetSupportedOk returns a tuple with the Supported field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) GetSupportedOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.Supported) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Supported, true
|
||||
}
|
||||
|
||||
// HasSupported returns a boolean if a field has been set.
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) HasSupported() bool {
|
||||
if o != nil && !IsNil(o.Supported) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetSupported gets a reference to the given bool and assigns it to the Supported field.
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) SetSupported(v bool) {
|
||||
o.Supported = &v
|
||||
}
|
||||
|
||||
// GetLatest returns the Latest field value if set, zero value otherwise (both if not set or set to explicit null).
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) GetLatest() string {
|
||||
if o == nil || IsNil(o.Latest.Get()) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Latest.Get()
|
||||
}
|
||||
|
||||
// GetLatestOk returns a tuple with the Latest field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) GetLatestOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.Latest.Get(), o.Latest.IsSet()
|
||||
}
|
||||
|
||||
// HasLatest returns a boolean if a field has been set.
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) HasLatest() bool {
|
||||
if o != nil && o.Latest.IsSet() {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLatest gets a reference to the given NullableString and assigns it to the Latest field.
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) SetLatest(v string) {
|
||||
o.Latest.Set(&v)
|
||||
}
|
||||
// SetLatestNil sets the value for Latest to be an explicit nil
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) SetLatestNil() {
|
||||
o.Latest.Set(nil)
|
||||
}
|
||||
|
||||
// UnsetLatest ensures that no value is present for Latest, not even an explicit nil
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) UnsetLatest() {
|
||||
o.Latest.Unset()
|
||||
}
|
||||
|
||||
// GetLatestStable returns the LatestStable field value if set, zero value otherwise (both if not set or set to explicit null).
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) GetLatestStable() string {
|
||||
if o == nil || IsNil(o.LatestStable.Get()) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.LatestStable.Get()
|
||||
}
|
||||
|
||||
// GetLatestStableOk returns a tuple with the LatestStable field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) GetLatestStableOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.LatestStable.Get(), o.LatestStable.IsSet()
|
||||
}
|
||||
|
||||
// HasLatestStable returns a boolean if a field has been set.
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) HasLatestStable() bool {
|
||||
if o != nil && o.LatestStable.IsSet() {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLatestStable gets a reference to the given NullableString and assigns it to the LatestStable field.
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) SetLatestStable(v string) {
|
||||
o.LatestStable.Set(&v)
|
||||
}
|
||||
// SetLatestStableNil sets the value for LatestStable to be an explicit nil
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) SetLatestStableNil() {
|
||||
o.LatestStable.Set(nil)
|
||||
}
|
||||
|
||||
// UnsetLatestStable ensures that no value is present for LatestStable, not even an explicit nil
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) UnsetLatestStable() {
|
||||
o.LatestStable.Unset()
|
||||
}
|
||||
|
||||
// GetLatestBeta returns the LatestBeta field value if set, zero value otherwise (both if not set or set to explicit null).
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) GetLatestBeta() string {
|
||||
if o == nil || IsNil(o.LatestBeta.Get()) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.LatestBeta.Get()
|
||||
}
|
||||
|
||||
// GetLatestBetaOk returns a tuple with the LatestBeta field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) GetLatestBetaOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.LatestBeta.Get(), o.LatestBeta.IsSet()
|
||||
}
|
||||
|
||||
// HasLatestBeta returns a boolean if a field has been set.
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) HasLatestBeta() bool {
|
||||
if o != nil && o.LatestBeta.IsSet() {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLatestBeta gets a reference to the given NullableString and assigns it to the LatestBeta field.
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) SetLatestBeta(v string) {
|
||||
o.LatestBeta.Set(&v)
|
||||
}
|
||||
// SetLatestBetaNil sets the value for LatestBeta to be an explicit nil
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) SetLatestBetaNil() {
|
||||
o.LatestBeta.Set(nil)
|
||||
}
|
||||
|
||||
// UnsetLatestBeta ensures that no value is present for LatestBeta, not even an explicit nil
|
||||
func (o *V1ReleasesPlatformVersionGet200Response) UnsetLatestBeta() {
|
||||
o.LatestBeta.Unset()
|
||||
}
|
||||
|
||||
func (o V1ReleasesPlatformVersionGet200Response) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o V1ReleasesPlatformVersionGet200Response) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Supported) {
|
||||
toSerialize["supported"] = o.Supported
|
||||
}
|
||||
if o.Latest.IsSet() {
|
||||
toSerialize["latest"] = o.Latest.Get()
|
||||
}
|
||||
if o.LatestStable.IsSet() {
|
||||
toSerialize["latest_stable"] = o.LatestStable.Get()
|
||||
}
|
||||
if o.LatestBeta.IsSet() {
|
||||
toSerialize["latest_beta"] = o.LatestBeta.Get()
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableV1ReleasesPlatformVersionGet200Response struct {
|
||||
value *V1ReleasesPlatformVersionGet200Response
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableV1ReleasesPlatformVersionGet200Response) Get() *V1ReleasesPlatformVersionGet200Response {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableV1ReleasesPlatformVersionGet200Response) Set(val *V1ReleasesPlatformVersionGet200Response) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableV1ReleasesPlatformVersionGet200Response) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableV1ReleasesPlatformVersionGet200Response) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableV1ReleasesPlatformVersionGet200Response(val *V1ReleasesPlatformVersionGet200Response) *NullableV1ReleasesPlatformVersionGet200Response {
|
||||
return &NullableV1ReleasesPlatformVersionGet200Response{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableV1ReleasesPlatformVersionGet200Response) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableV1ReleasesPlatformVersionGet200Response) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
188
pkg/mullvad_api/model__v1_replace_wireguard_key_post_request.go
Normal file
188
pkg/mullvad_api/model__v1_replace_wireguard_key_post_request.go
Normal file
@ -0,0 +1,188 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"bytes"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// checks if the V1ReplaceWireguardKeyPostRequest type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &V1ReplaceWireguardKeyPostRequest{}
|
||||
|
||||
// V1ReplaceWireguardKeyPostRequest struct for V1ReplaceWireguardKeyPostRequest
|
||||
type V1ReplaceWireguardKeyPostRequest struct {
|
||||
// The WireGuard public key to remove
|
||||
Old string `json:"old"`
|
||||
// The WireGuard public key to add
|
||||
New string `json:"new"`
|
||||
}
|
||||
|
||||
type _V1ReplaceWireguardKeyPostRequest V1ReplaceWireguardKeyPostRequest
|
||||
|
||||
// NewV1ReplaceWireguardKeyPostRequest instantiates a new V1ReplaceWireguardKeyPostRequest 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 NewV1ReplaceWireguardKeyPostRequest(old string, new string) *V1ReplaceWireguardKeyPostRequest {
|
||||
this := V1ReplaceWireguardKeyPostRequest{}
|
||||
this.Old = old
|
||||
this.New = new
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewV1ReplaceWireguardKeyPostRequestWithDefaults instantiates a new V1ReplaceWireguardKeyPostRequest 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 NewV1ReplaceWireguardKeyPostRequestWithDefaults() *V1ReplaceWireguardKeyPostRequest {
|
||||
this := V1ReplaceWireguardKeyPostRequest{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetOld returns the Old field value
|
||||
func (o *V1ReplaceWireguardKeyPostRequest) GetOld() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Old
|
||||
}
|
||||
|
||||
// GetOldOk returns a tuple with the Old field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1ReplaceWireguardKeyPostRequest) GetOldOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Old, true
|
||||
}
|
||||
|
||||
// SetOld sets field value
|
||||
func (o *V1ReplaceWireguardKeyPostRequest) SetOld(v string) {
|
||||
o.Old = v
|
||||
}
|
||||
|
||||
// GetNew returns the New field value
|
||||
func (o *V1ReplaceWireguardKeyPostRequest) GetNew() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.New
|
||||
}
|
||||
|
||||
// GetNewOk returns a tuple with the New field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1ReplaceWireguardKeyPostRequest) GetNewOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.New, true
|
||||
}
|
||||
|
||||
// SetNew sets field value
|
||||
func (o *V1ReplaceWireguardKeyPostRequest) SetNew(v string) {
|
||||
o.New = v
|
||||
}
|
||||
|
||||
func (o V1ReplaceWireguardKeyPostRequest) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o V1ReplaceWireguardKeyPostRequest) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
toSerialize["old"] = o.Old
|
||||
toSerialize["new"] = o.New
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *V1ReplaceWireguardKeyPostRequest) 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{
|
||||
"old",
|
||||
"new",
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
varV1ReplaceWireguardKeyPostRequest := _V1ReplaceWireguardKeyPostRequest{}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
err = decoder.Decode(&varV1ReplaceWireguardKeyPostRequest)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = V1ReplaceWireguardKeyPostRequest(varV1ReplaceWireguardKeyPostRequest)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableV1ReplaceWireguardKeyPostRequest struct {
|
||||
value *V1ReplaceWireguardKeyPostRequest
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableV1ReplaceWireguardKeyPostRequest) Get() *V1ReplaceWireguardKeyPostRequest {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableV1ReplaceWireguardKeyPostRequest) Set(val *V1ReplaceWireguardKeyPostRequest) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableV1ReplaceWireguardKeyPostRequest) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableV1ReplaceWireguardKeyPostRequest) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableV1ReplaceWireguardKeyPostRequest(val *V1ReplaceWireguardKeyPostRequest) *NullableV1ReplaceWireguardKeyPostRequest {
|
||||
return &NullableV1ReplaceWireguardKeyPostRequest{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableV1ReplaceWireguardKeyPostRequest) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableV1ReplaceWireguardKeyPostRequest) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
162
pkg/mullvad_api/model__v1_submit_voucher_post_200_response.go
Normal file
162
pkg/mullvad_api/model__v1_submit_voucher_post_200_response.go
Normal file
@ -0,0 +1,162 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the V1SubmitVoucherPost200Response type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &V1SubmitVoucherPost200Response{}
|
||||
|
||||
// V1SubmitVoucherPost200Response struct for V1SubmitVoucherPost200Response
|
||||
type V1SubmitVoucherPost200Response struct {
|
||||
TimeAdded *float32 `json:"time_added,omitempty"`
|
||||
NewExpiry *string `json:"new_expiry,omitempty"`
|
||||
}
|
||||
|
||||
// NewV1SubmitVoucherPost200Response instantiates a new V1SubmitVoucherPost200Response 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 NewV1SubmitVoucherPost200Response() *V1SubmitVoucherPost200Response {
|
||||
this := V1SubmitVoucherPost200Response{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewV1SubmitVoucherPost200ResponseWithDefaults instantiates a new V1SubmitVoucherPost200Response 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 NewV1SubmitVoucherPost200ResponseWithDefaults() *V1SubmitVoucherPost200Response {
|
||||
this := V1SubmitVoucherPost200Response{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetTimeAdded returns the TimeAdded field value if set, zero value otherwise.
|
||||
func (o *V1SubmitVoucherPost200Response) GetTimeAdded() float32 {
|
||||
if o == nil || IsNil(o.TimeAdded) {
|
||||
var ret float32
|
||||
return ret
|
||||
}
|
||||
return *o.TimeAdded
|
||||
}
|
||||
|
||||
// GetTimeAddedOk returns a tuple with the TimeAdded field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1SubmitVoucherPost200Response) GetTimeAddedOk() (*float32, bool) {
|
||||
if o == nil || IsNil(o.TimeAdded) {
|
||||
return nil, false
|
||||
}
|
||||
return o.TimeAdded, true
|
||||
}
|
||||
|
||||
// HasTimeAdded returns a boolean if a field has been set.
|
||||
func (o *V1SubmitVoucherPost200Response) HasTimeAdded() bool {
|
||||
if o != nil && !IsNil(o.TimeAdded) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetTimeAdded gets a reference to the given float32 and assigns it to the TimeAdded field.
|
||||
func (o *V1SubmitVoucherPost200Response) SetTimeAdded(v float32) {
|
||||
o.TimeAdded = &v
|
||||
}
|
||||
|
||||
// GetNewExpiry returns the NewExpiry field value if set, zero value otherwise.
|
||||
func (o *V1SubmitVoucherPost200Response) GetNewExpiry() string {
|
||||
if o == nil || IsNil(o.NewExpiry) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.NewExpiry
|
||||
}
|
||||
|
||||
// GetNewExpiryOk returns a tuple with the NewExpiry field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1SubmitVoucherPost200Response) GetNewExpiryOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.NewExpiry) {
|
||||
return nil, false
|
||||
}
|
||||
return o.NewExpiry, true
|
||||
}
|
||||
|
||||
// HasNewExpiry returns a boolean if a field has been set.
|
||||
func (o *V1SubmitVoucherPost200Response) HasNewExpiry() bool {
|
||||
if o != nil && !IsNil(o.NewExpiry) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetNewExpiry gets a reference to the given string and assigns it to the NewExpiry field.
|
||||
func (o *V1SubmitVoucherPost200Response) SetNewExpiry(v string) {
|
||||
o.NewExpiry = &v
|
||||
}
|
||||
|
||||
func (o V1SubmitVoucherPost200Response) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o V1SubmitVoucherPost200Response) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.TimeAdded) {
|
||||
toSerialize["time_added"] = o.TimeAdded
|
||||
}
|
||||
if !IsNil(o.NewExpiry) {
|
||||
toSerialize["new_expiry"] = o.NewExpiry
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableV1SubmitVoucherPost200Response struct {
|
||||
value *V1SubmitVoucherPost200Response
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableV1SubmitVoucherPost200Response) Get() *V1SubmitVoucherPost200Response {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableV1SubmitVoucherPost200Response) Set(val *V1SubmitVoucherPost200Response) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableV1SubmitVoucherPost200Response) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableV1SubmitVoucherPost200Response) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableV1SubmitVoucherPost200Response(val *V1SubmitVoucherPost200Response) *NullableV1SubmitVoucherPost200Response {
|
||||
return &NullableV1SubmitVoucherPost200Response{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableV1SubmitVoucherPost200Response) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableV1SubmitVoucherPost200Response) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
158
pkg/mullvad_api/model__v1_submit_voucher_post_request.go
Normal file
158
pkg/mullvad_api/model__v1_submit_voucher_post_request.go
Normal file
@ -0,0 +1,158 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"bytes"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// checks if the V1SubmitVoucherPostRequest type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &V1SubmitVoucherPostRequest{}
|
||||
|
||||
// V1SubmitVoucherPostRequest struct for V1SubmitVoucherPostRequest
|
||||
type V1SubmitVoucherPostRequest struct {
|
||||
VoucherCode string `json:"voucher_code"`
|
||||
}
|
||||
|
||||
type _V1SubmitVoucherPostRequest V1SubmitVoucherPostRequest
|
||||
|
||||
// NewV1SubmitVoucherPostRequest instantiates a new V1SubmitVoucherPostRequest 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 NewV1SubmitVoucherPostRequest(voucherCode string) *V1SubmitVoucherPostRequest {
|
||||
this := V1SubmitVoucherPostRequest{}
|
||||
this.VoucherCode = voucherCode
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewV1SubmitVoucherPostRequestWithDefaults instantiates a new V1SubmitVoucherPostRequest 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 NewV1SubmitVoucherPostRequestWithDefaults() *V1SubmitVoucherPostRequest {
|
||||
this := V1SubmitVoucherPostRequest{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetVoucherCode returns the VoucherCode field value
|
||||
func (o *V1SubmitVoucherPostRequest) GetVoucherCode() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.VoucherCode
|
||||
}
|
||||
|
||||
// GetVoucherCodeOk returns a tuple with the VoucherCode field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1SubmitVoucherPostRequest) GetVoucherCodeOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.VoucherCode, true
|
||||
}
|
||||
|
||||
// SetVoucherCode sets field value
|
||||
func (o *V1SubmitVoucherPostRequest) SetVoucherCode(v string) {
|
||||
o.VoucherCode = v
|
||||
}
|
||||
|
||||
func (o V1SubmitVoucherPostRequest) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o V1SubmitVoucherPostRequest) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
toSerialize["voucher_code"] = o.VoucherCode
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *V1SubmitVoucherPostRequest) 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{
|
||||
"voucher_code",
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
varV1SubmitVoucherPostRequest := _V1SubmitVoucherPostRequest{}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
err = decoder.Decode(&varV1SubmitVoucherPostRequest)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = V1SubmitVoucherPostRequest(varV1SubmitVoucherPostRequest)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableV1SubmitVoucherPostRequest struct {
|
||||
value *V1SubmitVoucherPostRequest
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableV1SubmitVoucherPostRequest) Get() *V1SubmitVoucherPostRequest {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableV1SubmitVoucherPostRequest) Set(val *V1SubmitVoucherPostRequest) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableV1SubmitVoucherPostRequest) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableV1SubmitVoucherPostRequest) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableV1SubmitVoucherPostRequest(val *V1SubmitVoucherPostRequest) *NullableV1SubmitVoucherPostRequest {
|
||||
return &NullableV1SubmitVoucherPostRequest{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableV1SubmitVoucherPostRequest) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableV1SubmitVoucherPostRequest) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
159
pkg/mullvad_api/model__v1_wireguard_keys_post_request.go
Normal file
159
pkg/mullvad_api/model__v1_wireguard_keys_post_request.go
Normal file
@ -0,0 +1,159 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"bytes"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// checks if the V1WireguardKeysPostRequest type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &V1WireguardKeysPostRequest{}
|
||||
|
||||
// V1WireguardKeysPostRequest struct for V1WireguardKeysPostRequest
|
||||
type V1WireguardKeysPostRequest struct {
|
||||
// The WireGuard public key to add
|
||||
Pubkey string `json:"pubkey"`
|
||||
}
|
||||
|
||||
type _V1WireguardKeysPostRequest V1WireguardKeysPostRequest
|
||||
|
||||
// NewV1WireguardKeysPostRequest instantiates a new V1WireguardKeysPostRequest 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 NewV1WireguardKeysPostRequest(pubkey string) *V1WireguardKeysPostRequest {
|
||||
this := V1WireguardKeysPostRequest{}
|
||||
this.Pubkey = pubkey
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewV1WireguardKeysPostRequestWithDefaults instantiates a new V1WireguardKeysPostRequest 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 NewV1WireguardKeysPostRequestWithDefaults() *V1WireguardKeysPostRequest {
|
||||
this := V1WireguardKeysPostRequest{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetPubkey returns the Pubkey field value
|
||||
func (o *V1WireguardKeysPostRequest) GetPubkey() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Pubkey
|
||||
}
|
||||
|
||||
// GetPubkeyOk returns a tuple with the Pubkey field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1WireguardKeysPostRequest) GetPubkeyOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Pubkey, true
|
||||
}
|
||||
|
||||
// SetPubkey sets field value
|
||||
func (o *V1WireguardKeysPostRequest) SetPubkey(v string) {
|
||||
o.Pubkey = v
|
||||
}
|
||||
|
||||
func (o V1WireguardKeysPostRequest) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o V1WireguardKeysPostRequest) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
toSerialize["pubkey"] = o.Pubkey
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *V1WireguardKeysPostRequest) 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{
|
||||
"pubkey",
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
varV1WireguardKeysPostRequest := _V1WireguardKeysPostRequest{}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
err = decoder.Decode(&varV1WireguardKeysPostRequest)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = V1WireguardKeysPostRequest(varV1WireguardKeysPostRequest)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableV1WireguardKeysPostRequest struct {
|
||||
value *V1WireguardKeysPostRequest
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableV1WireguardKeysPostRequest) Get() *V1WireguardKeysPostRequest {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableV1WireguardKeysPostRequest) Set(val *V1WireguardKeysPostRequest) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableV1WireguardKeysPostRequest) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableV1WireguardKeysPostRequest) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableV1WireguardKeysPostRequest(val *V1WireguardKeysPostRequest) *NullableV1WireguardKeysPostRequest {
|
||||
return &NullableV1WireguardKeysPostRequest{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableV1WireguardKeysPostRequest) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableV1WireguardKeysPostRequest) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
126
pkg/mullvad_api/model__v1_www_auth_token_post_200_response.go
Normal file
126
pkg/mullvad_api/model__v1_www_auth_token_post_200_response.go
Normal file
@ -0,0 +1,126 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the V1WwwAuthTokenPost200Response type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &V1WwwAuthTokenPost200Response{}
|
||||
|
||||
// V1WwwAuthTokenPost200Response struct for V1WwwAuthTokenPost200Response
|
||||
type V1WwwAuthTokenPost200Response struct {
|
||||
AuthToken *string `json:"auth_token,omitempty"`
|
||||
}
|
||||
|
||||
// NewV1WwwAuthTokenPost200Response instantiates a new V1WwwAuthTokenPost200Response 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 NewV1WwwAuthTokenPost200Response() *V1WwwAuthTokenPost200Response {
|
||||
this := V1WwwAuthTokenPost200Response{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewV1WwwAuthTokenPost200ResponseWithDefaults instantiates a new V1WwwAuthTokenPost200Response 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 NewV1WwwAuthTokenPost200ResponseWithDefaults() *V1WwwAuthTokenPost200Response {
|
||||
this := V1WwwAuthTokenPost200Response{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetAuthToken returns the AuthToken field value if set, zero value otherwise.
|
||||
func (o *V1WwwAuthTokenPost200Response) GetAuthToken() string {
|
||||
if o == nil || IsNil(o.AuthToken) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.AuthToken
|
||||
}
|
||||
|
||||
// GetAuthTokenOk returns a tuple with the AuthToken field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *V1WwwAuthTokenPost200Response) GetAuthTokenOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.AuthToken) {
|
||||
return nil, false
|
||||
}
|
||||
return o.AuthToken, true
|
||||
}
|
||||
|
||||
// HasAuthToken returns a boolean if a field has been set.
|
||||
func (o *V1WwwAuthTokenPost200Response) HasAuthToken() bool {
|
||||
if o != nil && !IsNil(o.AuthToken) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetAuthToken gets a reference to the given string and assigns it to the AuthToken field.
|
||||
func (o *V1WwwAuthTokenPost200Response) SetAuthToken(v string) {
|
||||
o.AuthToken = &v
|
||||
}
|
||||
|
||||
func (o V1WwwAuthTokenPost200Response) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o V1WwwAuthTokenPost200Response) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.AuthToken) {
|
||||
toSerialize["auth_token"] = o.AuthToken
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableV1WwwAuthTokenPost200Response struct {
|
||||
value *V1WwwAuthTokenPost200Response
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableV1WwwAuthTokenPost200Response) Get() *V1WwwAuthTokenPost200Response {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableV1WwwAuthTokenPost200Response) Set(val *V1WwwAuthTokenPost200Response) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableV1WwwAuthTokenPost200Response) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableV1WwwAuthTokenPost200Response) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableV1WwwAuthTokenPost200Response(val *V1WwwAuthTokenPost200Response) *NullableV1WwwAuthTokenPost200Response {
|
||||
return &NullableV1WwwAuthTokenPost200Response{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableV1WwwAuthTokenPost200Response) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableV1WwwAuthTokenPost200Response) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
378
pkg/mullvad_api/model_bridge_relay.go
Normal file
378
pkg/mullvad_api/model_bridge_relay.go
Normal file
@ -0,0 +1,378 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the BridgeRelay type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &BridgeRelay{}
|
||||
|
||||
// BridgeRelay struct for BridgeRelay
|
||||
type BridgeRelay struct {
|
||||
Hostname *string `json:"hostname,omitempty"`
|
||||
Location *string `json:"location,omitempty"`
|
||||
Active *bool `json:"active,omitempty"`
|
||||
Owned *bool `json:"owned,omitempty"`
|
||||
Provider *string `json:"provider,omitempty"`
|
||||
Ipv4AddrIn *string `json:"ipv4_addr_in,omitempty"`
|
||||
IncludeInCountry *bool `json:"include_in_country,omitempty"`
|
||||
Weight *int32 `json:"weight,omitempty"`
|
||||
}
|
||||
|
||||
// NewBridgeRelay instantiates a new BridgeRelay 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 NewBridgeRelay() *BridgeRelay {
|
||||
this := BridgeRelay{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewBridgeRelayWithDefaults instantiates a new BridgeRelay 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 NewBridgeRelayWithDefaults() *BridgeRelay {
|
||||
this := BridgeRelay{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetHostname returns the Hostname field value if set, zero value otherwise.
|
||||
func (o *BridgeRelay) GetHostname() string {
|
||||
if o == nil || IsNil(o.Hostname) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Hostname
|
||||
}
|
||||
|
||||
// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *BridgeRelay) GetHostnameOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Hostname) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Hostname, true
|
||||
}
|
||||
|
||||
// HasHostname returns a boolean if a field has been set.
|
||||
func (o *BridgeRelay) HasHostname() bool {
|
||||
if o != nil && !IsNil(o.Hostname) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetHostname gets a reference to the given string and assigns it to the Hostname field.
|
||||
func (o *BridgeRelay) SetHostname(v string) {
|
||||
o.Hostname = &v
|
||||
}
|
||||
|
||||
// GetLocation returns the Location field value if set, zero value otherwise.
|
||||
func (o *BridgeRelay) GetLocation() string {
|
||||
if o == nil || IsNil(o.Location) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Location
|
||||
}
|
||||
|
||||
// GetLocationOk returns a tuple with the Location field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *BridgeRelay) GetLocationOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Location) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Location, true
|
||||
}
|
||||
|
||||
// HasLocation returns a boolean if a field has been set.
|
||||
func (o *BridgeRelay) HasLocation() bool {
|
||||
if o != nil && !IsNil(o.Location) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLocation gets a reference to the given string and assigns it to the Location field.
|
||||
func (o *BridgeRelay) SetLocation(v string) {
|
||||
o.Location = &v
|
||||
}
|
||||
|
||||
// GetActive returns the Active field value if set, zero value otherwise.
|
||||
func (o *BridgeRelay) 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 *BridgeRelay) 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 *BridgeRelay) 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 *BridgeRelay) SetActive(v bool) {
|
||||
o.Active = &v
|
||||
}
|
||||
|
||||
// GetOwned returns the Owned field value if set, zero value otherwise.
|
||||
func (o *BridgeRelay) GetOwned() bool {
|
||||
if o == nil || IsNil(o.Owned) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.Owned
|
||||
}
|
||||
|
||||
// GetOwnedOk returns a tuple with the Owned field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *BridgeRelay) GetOwnedOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.Owned) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Owned, true
|
||||
}
|
||||
|
||||
// HasOwned returns a boolean if a field has been set.
|
||||
func (o *BridgeRelay) HasOwned() bool {
|
||||
if o != nil && !IsNil(o.Owned) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOwned gets a reference to the given bool and assigns it to the Owned field.
|
||||
func (o *BridgeRelay) SetOwned(v bool) {
|
||||
o.Owned = &v
|
||||
}
|
||||
|
||||
// GetProvider returns the Provider field value if set, zero value otherwise.
|
||||
func (o *BridgeRelay) GetProvider() string {
|
||||
if o == nil || IsNil(o.Provider) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Provider
|
||||
}
|
||||
|
||||
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *BridgeRelay) GetProviderOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Provider) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Provider, true
|
||||
}
|
||||
|
||||
// HasProvider returns a boolean if a field has been set.
|
||||
func (o *BridgeRelay) HasProvider() bool {
|
||||
if o != nil && !IsNil(o.Provider) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetProvider gets a reference to the given string and assigns it to the Provider field.
|
||||
func (o *BridgeRelay) SetProvider(v string) {
|
||||
o.Provider = &v
|
||||
}
|
||||
|
||||
// GetIpv4AddrIn returns the Ipv4AddrIn field value if set, zero value otherwise.
|
||||
func (o *BridgeRelay) GetIpv4AddrIn() string {
|
||||
if o == nil || IsNil(o.Ipv4AddrIn) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Ipv4AddrIn
|
||||
}
|
||||
|
||||
// GetIpv4AddrInOk returns a tuple with the Ipv4AddrIn field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *BridgeRelay) GetIpv4AddrInOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Ipv4AddrIn) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Ipv4AddrIn, true
|
||||
}
|
||||
|
||||
// HasIpv4AddrIn returns a boolean if a field has been set.
|
||||
func (o *BridgeRelay) HasIpv4AddrIn() bool {
|
||||
if o != nil && !IsNil(o.Ipv4AddrIn) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetIpv4AddrIn gets a reference to the given string and assigns it to the Ipv4AddrIn field.
|
||||
func (o *BridgeRelay) SetIpv4AddrIn(v string) {
|
||||
o.Ipv4AddrIn = &v
|
||||
}
|
||||
|
||||
// GetIncludeInCountry returns the IncludeInCountry field value if set, zero value otherwise.
|
||||
func (o *BridgeRelay) GetIncludeInCountry() bool {
|
||||
if o == nil || IsNil(o.IncludeInCountry) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.IncludeInCountry
|
||||
}
|
||||
|
||||
// GetIncludeInCountryOk returns a tuple with the IncludeInCountry field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *BridgeRelay) GetIncludeInCountryOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.IncludeInCountry) {
|
||||
return nil, false
|
||||
}
|
||||
return o.IncludeInCountry, true
|
||||
}
|
||||
|
||||
// HasIncludeInCountry returns a boolean if a field has been set.
|
||||
func (o *BridgeRelay) HasIncludeInCountry() bool {
|
||||
if o != nil && !IsNil(o.IncludeInCountry) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetIncludeInCountry gets a reference to the given bool and assigns it to the IncludeInCountry field.
|
||||
func (o *BridgeRelay) SetIncludeInCountry(v bool) {
|
||||
o.IncludeInCountry = &v
|
||||
}
|
||||
|
||||
// GetWeight returns the Weight field value if set, zero value otherwise.
|
||||
func (o *BridgeRelay) GetWeight() int32 {
|
||||
if o == nil || IsNil(o.Weight) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.Weight
|
||||
}
|
||||
|
||||
// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *BridgeRelay) GetWeightOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.Weight) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Weight, true
|
||||
}
|
||||
|
||||
// HasWeight returns a boolean if a field has been set.
|
||||
func (o *BridgeRelay) HasWeight() bool {
|
||||
if o != nil && !IsNil(o.Weight) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetWeight gets a reference to the given int32 and assigns it to the Weight field.
|
||||
func (o *BridgeRelay) SetWeight(v int32) {
|
||||
o.Weight = &v
|
||||
}
|
||||
|
||||
func (o BridgeRelay) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o BridgeRelay) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Hostname) {
|
||||
toSerialize["hostname"] = o.Hostname
|
||||
}
|
||||
if !IsNil(o.Location) {
|
||||
toSerialize["location"] = o.Location
|
||||
}
|
||||
if !IsNil(o.Active) {
|
||||
toSerialize["active"] = o.Active
|
||||
}
|
||||
if !IsNil(o.Owned) {
|
||||
toSerialize["owned"] = o.Owned
|
||||
}
|
||||
if !IsNil(o.Provider) {
|
||||
toSerialize["provider"] = o.Provider
|
||||
}
|
||||
if !IsNil(o.Ipv4AddrIn) {
|
||||
toSerialize["ipv4_addr_in"] = o.Ipv4AddrIn
|
||||
}
|
||||
if !IsNil(o.IncludeInCountry) {
|
||||
toSerialize["include_in_country"] = o.IncludeInCountry
|
||||
}
|
||||
if !IsNil(o.Weight) {
|
||||
toSerialize["weight"] = o.Weight
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableBridgeRelay struct {
|
||||
value *BridgeRelay
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableBridgeRelay) Get() *BridgeRelay {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableBridgeRelay) Set(val *BridgeRelay) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableBridgeRelay) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableBridgeRelay) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableBridgeRelay(val *BridgeRelay) *NullableBridgeRelay {
|
||||
return &NullableBridgeRelay{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableBridgeRelay) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableBridgeRelay) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
164
pkg/mullvad_api/model_error_schema.go
Normal file
164
pkg/mullvad_api/model_error_schema.go
Normal file
@ -0,0 +1,164 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the ErrorSchema type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &ErrorSchema{}
|
||||
|
||||
// ErrorSchema struct for ErrorSchema
|
||||
type ErrorSchema struct {
|
||||
// The error code.
|
||||
Code *string `json:"code,omitempty"`
|
||||
// The error message.
|
||||
Error *string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
// NewErrorSchema instantiates a new ErrorSchema 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 NewErrorSchema() *ErrorSchema {
|
||||
this := ErrorSchema{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewErrorSchemaWithDefaults instantiates a new ErrorSchema 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 NewErrorSchemaWithDefaults() *ErrorSchema {
|
||||
this := ErrorSchema{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetCode returns the Code field value if set, zero value otherwise.
|
||||
func (o *ErrorSchema) GetCode() string {
|
||||
if o == nil || IsNil(o.Code) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Code
|
||||
}
|
||||
|
||||
// GetCodeOk returns a tuple with the Code field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ErrorSchema) GetCodeOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Code) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Code, true
|
||||
}
|
||||
|
||||
// HasCode returns a boolean if a field has been set.
|
||||
func (o *ErrorSchema) HasCode() bool {
|
||||
if o != nil && !IsNil(o.Code) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetCode gets a reference to the given string and assigns it to the Code field.
|
||||
func (o *ErrorSchema) SetCode(v string) {
|
||||
o.Code = &v
|
||||
}
|
||||
|
||||
// GetError returns the Error field value if set, zero value otherwise.
|
||||
func (o *ErrorSchema) GetError() string {
|
||||
if o == nil || IsNil(o.Error) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Error
|
||||
}
|
||||
|
||||
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ErrorSchema) GetErrorOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Error) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Error, true
|
||||
}
|
||||
|
||||
// HasError returns a boolean if a field has been set.
|
||||
func (o *ErrorSchema) HasError() bool {
|
||||
if o != nil && !IsNil(o.Error) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetError gets a reference to the given string and assigns it to the Error field.
|
||||
func (o *ErrorSchema) SetError(v string) {
|
||||
o.Error = &v
|
||||
}
|
||||
|
||||
func (o ErrorSchema) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o ErrorSchema) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Code) {
|
||||
toSerialize["code"] = o.Code
|
||||
}
|
||||
if !IsNil(o.Error) {
|
||||
toSerialize["error"] = o.Error
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableErrorSchema struct {
|
||||
value *ErrorSchema
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableErrorSchema) Get() *ErrorSchema {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableErrorSchema) Set(val *ErrorSchema) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableErrorSchema) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableErrorSchema) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableErrorSchema(val *ErrorSchema) *NullableErrorSchema {
|
||||
return &NullableErrorSchema{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableErrorSchema) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableErrorSchema) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
234
pkg/mullvad_api/model_location.go
Normal file
234
pkg/mullvad_api/model_location.go
Normal file
@ -0,0 +1,234 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the Location type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Location{}
|
||||
|
||||
// Location struct for Location
|
||||
type Location struct {
|
||||
City *string `json:"city,omitempty"`
|
||||
Country *string `json:"country,omitempty"`
|
||||
Latitude *float32 `json:"latitude,omitempty"`
|
||||
Longitude *float32 `json:"longitude,omitempty"`
|
||||
}
|
||||
|
||||
// NewLocation instantiates a new Location 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 NewLocation() *Location {
|
||||
this := Location{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewLocationWithDefaults instantiates a new Location 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 NewLocationWithDefaults() *Location {
|
||||
this := Location{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetCity returns the City field value if set, zero value otherwise.
|
||||
func (o *Location) GetCity() string {
|
||||
if o == nil || IsNil(o.City) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.City
|
||||
}
|
||||
|
||||
// GetCityOk returns a tuple with the City field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Location) GetCityOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.City) {
|
||||
return nil, false
|
||||
}
|
||||
return o.City, true
|
||||
}
|
||||
|
||||
// HasCity returns a boolean if a field has been set.
|
||||
func (o *Location) HasCity() bool {
|
||||
if o != nil && !IsNil(o.City) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetCity gets a reference to the given string and assigns it to the City field.
|
||||
func (o *Location) SetCity(v string) {
|
||||
o.City = &v
|
||||
}
|
||||
|
||||
// GetCountry returns the Country field value if set, zero value otherwise.
|
||||
func (o *Location) GetCountry() string {
|
||||
if o == nil || IsNil(o.Country) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Country
|
||||
}
|
||||
|
||||
// GetCountryOk returns a tuple with the Country field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Location) GetCountryOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Country) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Country, true
|
||||
}
|
||||
|
||||
// HasCountry returns a boolean if a field has been set.
|
||||
func (o *Location) HasCountry() bool {
|
||||
if o != nil && !IsNil(o.Country) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetCountry gets a reference to the given string and assigns it to the Country field.
|
||||
func (o *Location) SetCountry(v string) {
|
||||
o.Country = &v
|
||||
}
|
||||
|
||||
// GetLatitude returns the Latitude field value if set, zero value otherwise.
|
||||
func (o *Location) GetLatitude() float32 {
|
||||
if o == nil || IsNil(o.Latitude) {
|
||||
var ret float32
|
||||
return ret
|
||||
}
|
||||
return *o.Latitude
|
||||
}
|
||||
|
||||
// GetLatitudeOk returns a tuple with the Latitude field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Location) GetLatitudeOk() (*float32, bool) {
|
||||
if o == nil || IsNil(o.Latitude) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Latitude, true
|
||||
}
|
||||
|
||||
// HasLatitude returns a boolean if a field has been set.
|
||||
func (o *Location) HasLatitude() bool {
|
||||
if o != nil && !IsNil(o.Latitude) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLatitude gets a reference to the given float32 and assigns it to the Latitude field.
|
||||
func (o *Location) SetLatitude(v float32) {
|
||||
o.Latitude = &v
|
||||
}
|
||||
|
||||
// GetLongitude returns the Longitude field value if set, zero value otherwise.
|
||||
func (o *Location) GetLongitude() float32 {
|
||||
if o == nil || IsNil(o.Longitude) {
|
||||
var ret float32
|
||||
return ret
|
||||
}
|
||||
return *o.Longitude
|
||||
}
|
||||
|
||||
// GetLongitudeOk returns a tuple with the Longitude field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Location) GetLongitudeOk() (*float32, bool) {
|
||||
if o == nil || IsNil(o.Longitude) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Longitude, true
|
||||
}
|
||||
|
||||
// HasLongitude returns a boolean if a field has been set.
|
||||
func (o *Location) HasLongitude() bool {
|
||||
if o != nil && !IsNil(o.Longitude) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLongitude gets a reference to the given float32 and assigns it to the Longitude field.
|
||||
func (o *Location) SetLongitude(v float32) {
|
||||
o.Longitude = &v
|
||||
}
|
||||
|
||||
func (o Location) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o Location) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.City) {
|
||||
toSerialize["city"] = o.City
|
||||
}
|
||||
if !IsNil(o.Country) {
|
||||
toSerialize["country"] = o.Country
|
||||
}
|
||||
if !IsNil(o.Latitude) {
|
||||
toSerialize["latitude"] = o.Latitude
|
||||
}
|
||||
if !IsNil(o.Longitude) {
|
||||
toSerialize["longitude"] = o.Longitude
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableLocation struct {
|
||||
value *Location
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableLocation) Get() *Location {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableLocation) Set(val *Location) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableLocation) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableLocation) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableLocation(val *Location) *NullableLocation {
|
||||
return &NullableLocation{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableLocation) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableLocation) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
378
pkg/mullvad_api/model_open_vpn_relay.go
Normal file
378
pkg/mullvad_api/model_open_vpn_relay.go
Normal file
@ -0,0 +1,378 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the OpenVpnRelay type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &OpenVpnRelay{}
|
||||
|
||||
// OpenVpnRelay struct for OpenVpnRelay
|
||||
type OpenVpnRelay struct {
|
||||
Hostname *string `json:"hostname,omitempty"`
|
||||
Location *string `json:"location,omitempty"`
|
||||
Active *bool `json:"active,omitempty"`
|
||||
Owned *bool `json:"owned,omitempty"`
|
||||
Provider *string `json:"provider,omitempty"`
|
||||
Ipv4AddrIn *string `json:"ipv4_addr_in,omitempty"`
|
||||
IncludeInCountry *bool `json:"include_in_country,omitempty"`
|
||||
Weight *int32 `json:"weight,omitempty"`
|
||||
}
|
||||
|
||||
// NewOpenVpnRelay instantiates a new OpenVpnRelay 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 NewOpenVpnRelay() *OpenVpnRelay {
|
||||
this := OpenVpnRelay{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewOpenVpnRelayWithDefaults instantiates a new OpenVpnRelay 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 NewOpenVpnRelayWithDefaults() *OpenVpnRelay {
|
||||
this := OpenVpnRelay{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetHostname returns the Hostname field value if set, zero value otherwise.
|
||||
func (o *OpenVpnRelay) GetHostname() string {
|
||||
if o == nil || IsNil(o.Hostname) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Hostname
|
||||
}
|
||||
|
||||
// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *OpenVpnRelay) GetHostnameOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Hostname) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Hostname, true
|
||||
}
|
||||
|
||||
// HasHostname returns a boolean if a field has been set.
|
||||
func (o *OpenVpnRelay) HasHostname() bool {
|
||||
if o != nil && !IsNil(o.Hostname) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetHostname gets a reference to the given string and assigns it to the Hostname field.
|
||||
func (o *OpenVpnRelay) SetHostname(v string) {
|
||||
o.Hostname = &v
|
||||
}
|
||||
|
||||
// GetLocation returns the Location field value if set, zero value otherwise.
|
||||
func (o *OpenVpnRelay) GetLocation() string {
|
||||
if o == nil || IsNil(o.Location) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Location
|
||||
}
|
||||
|
||||
// GetLocationOk returns a tuple with the Location field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *OpenVpnRelay) GetLocationOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Location) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Location, true
|
||||
}
|
||||
|
||||
// HasLocation returns a boolean if a field has been set.
|
||||
func (o *OpenVpnRelay) HasLocation() bool {
|
||||
if o != nil && !IsNil(o.Location) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLocation gets a reference to the given string and assigns it to the Location field.
|
||||
func (o *OpenVpnRelay) SetLocation(v string) {
|
||||
o.Location = &v
|
||||
}
|
||||
|
||||
// GetActive returns the Active field value if set, zero value otherwise.
|
||||
func (o *OpenVpnRelay) 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 *OpenVpnRelay) 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 *OpenVpnRelay) 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 *OpenVpnRelay) SetActive(v bool) {
|
||||
o.Active = &v
|
||||
}
|
||||
|
||||
// GetOwned returns the Owned field value if set, zero value otherwise.
|
||||
func (o *OpenVpnRelay) GetOwned() bool {
|
||||
if o == nil || IsNil(o.Owned) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.Owned
|
||||
}
|
||||
|
||||
// GetOwnedOk returns a tuple with the Owned field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *OpenVpnRelay) GetOwnedOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.Owned) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Owned, true
|
||||
}
|
||||
|
||||
// HasOwned returns a boolean if a field has been set.
|
||||
func (o *OpenVpnRelay) HasOwned() bool {
|
||||
if o != nil && !IsNil(o.Owned) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOwned gets a reference to the given bool and assigns it to the Owned field.
|
||||
func (o *OpenVpnRelay) SetOwned(v bool) {
|
||||
o.Owned = &v
|
||||
}
|
||||
|
||||
// GetProvider returns the Provider field value if set, zero value otherwise.
|
||||
func (o *OpenVpnRelay) GetProvider() string {
|
||||
if o == nil || IsNil(o.Provider) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Provider
|
||||
}
|
||||
|
||||
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *OpenVpnRelay) GetProviderOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Provider) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Provider, true
|
||||
}
|
||||
|
||||
// HasProvider returns a boolean if a field has been set.
|
||||
func (o *OpenVpnRelay) HasProvider() bool {
|
||||
if o != nil && !IsNil(o.Provider) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetProvider gets a reference to the given string and assigns it to the Provider field.
|
||||
func (o *OpenVpnRelay) SetProvider(v string) {
|
||||
o.Provider = &v
|
||||
}
|
||||
|
||||
// GetIpv4AddrIn returns the Ipv4AddrIn field value if set, zero value otherwise.
|
||||
func (o *OpenVpnRelay) GetIpv4AddrIn() string {
|
||||
if o == nil || IsNil(o.Ipv4AddrIn) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Ipv4AddrIn
|
||||
}
|
||||
|
||||
// GetIpv4AddrInOk returns a tuple with the Ipv4AddrIn field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *OpenVpnRelay) GetIpv4AddrInOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Ipv4AddrIn) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Ipv4AddrIn, true
|
||||
}
|
||||
|
||||
// HasIpv4AddrIn returns a boolean if a field has been set.
|
||||
func (o *OpenVpnRelay) HasIpv4AddrIn() bool {
|
||||
if o != nil && !IsNil(o.Ipv4AddrIn) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetIpv4AddrIn gets a reference to the given string and assigns it to the Ipv4AddrIn field.
|
||||
func (o *OpenVpnRelay) SetIpv4AddrIn(v string) {
|
||||
o.Ipv4AddrIn = &v
|
||||
}
|
||||
|
||||
// GetIncludeInCountry returns the IncludeInCountry field value if set, zero value otherwise.
|
||||
func (o *OpenVpnRelay) GetIncludeInCountry() bool {
|
||||
if o == nil || IsNil(o.IncludeInCountry) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.IncludeInCountry
|
||||
}
|
||||
|
||||
// GetIncludeInCountryOk returns a tuple with the IncludeInCountry field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *OpenVpnRelay) GetIncludeInCountryOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.IncludeInCountry) {
|
||||
return nil, false
|
||||
}
|
||||
return o.IncludeInCountry, true
|
||||
}
|
||||
|
||||
// HasIncludeInCountry returns a boolean if a field has been set.
|
||||
func (o *OpenVpnRelay) HasIncludeInCountry() bool {
|
||||
if o != nil && !IsNil(o.IncludeInCountry) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetIncludeInCountry gets a reference to the given bool and assigns it to the IncludeInCountry field.
|
||||
func (o *OpenVpnRelay) SetIncludeInCountry(v bool) {
|
||||
o.IncludeInCountry = &v
|
||||
}
|
||||
|
||||
// GetWeight returns the Weight field value if set, zero value otherwise.
|
||||
func (o *OpenVpnRelay) GetWeight() int32 {
|
||||
if o == nil || IsNil(o.Weight) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.Weight
|
||||
}
|
||||
|
||||
// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *OpenVpnRelay) GetWeightOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.Weight) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Weight, true
|
||||
}
|
||||
|
||||
// HasWeight returns a boolean if a field has been set.
|
||||
func (o *OpenVpnRelay) HasWeight() bool {
|
||||
if o != nil && !IsNil(o.Weight) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetWeight gets a reference to the given int32 and assigns it to the Weight field.
|
||||
func (o *OpenVpnRelay) SetWeight(v int32) {
|
||||
o.Weight = &v
|
||||
}
|
||||
|
||||
func (o OpenVpnRelay) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o OpenVpnRelay) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Hostname) {
|
||||
toSerialize["hostname"] = o.Hostname
|
||||
}
|
||||
if !IsNil(o.Location) {
|
||||
toSerialize["location"] = o.Location
|
||||
}
|
||||
if !IsNil(o.Active) {
|
||||
toSerialize["active"] = o.Active
|
||||
}
|
||||
if !IsNil(o.Owned) {
|
||||
toSerialize["owned"] = o.Owned
|
||||
}
|
||||
if !IsNil(o.Provider) {
|
||||
toSerialize["provider"] = o.Provider
|
||||
}
|
||||
if !IsNil(o.Ipv4AddrIn) {
|
||||
toSerialize["ipv4_addr_in"] = o.Ipv4AddrIn
|
||||
}
|
||||
if !IsNil(o.IncludeInCountry) {
|
||||
toSerialize["include_in_country"] = o.IncludeInCountry
|
||||
}
|
||||
if !IsNil(o.Weight) {
|
||||
toSerialize["weight"] = o.Weight
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableOpenVpnRelay struct {
|
||||
value *OpenVpnRelay
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableOpenVpnRelay) Get() *OpenVpnRelay {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableOpenVpnRelay) Set(val *OpenVpnRelay) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableOpenVpnRelay) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableOpenVpnRelay) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableOpenVpnRelay(val *OpenVpnRelay) *NullableOpenVpnRelay {
|
||||
return &NullableOpenVpnRelay{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableOpenVpnRelay) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableOpenVpnRelay) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
378
pkg/mullvad_api/model_relay.go
Normal file
378
pkg/mullvad_api/model_relay.go
Normal file
@ -0,0 +1,378 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the Relay type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Relay{}
|
||||
|
||||
// Relay struct for Relay
|
||||
type Relay struct {
|
||||
Hostname *string `json:"hostname,omitempty"`
|
||||
Location *string `json:"location,omitempty"`
|
||||
Active *bool `json:"active,omitempty"`
|
||||
Owned *bool `json:"owned,omitempty"`
|
||||
Provider *string `json:"provider,omitempty"`
|
||||
Ipv4AddrIn *string `json:"ipv4_addr_in,omitempty"`
|
||||
IncludeInCountry *bool `json:"include_in_country,omitempty"`
|
||||
Weight *int32 `json:"weight,omitempty"`
|
||||
}
|
||||
|
||||
// NewRelay instantiates a new Relay 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 NewRelay() *Relay {
|
||||
this := Relay{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewRelayWithDefaults instantiates a new Relay 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 NewRelayWithDefaults() *Relay {
|
||||
this := Relay{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetHostname returns the Hostname field value if set, zero value otherwise.
|
||||
func (o *Relay) GetHostname() string {
|
||||
if o == nil || IsNil(o.Hostname) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Hostname
|
||||
}
|
||||
|
||||
// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Relay) GetHostnameOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Hostname) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Hostname, true
|
||||
}
|
||||
|
||||
// HasHostname returns a boolean if a field has been set.
|
||||
func (o *Relay) HasHostname() bool {
|
||||
if o != nil && !IsNil(o.Hostname) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetHostname gets a reference to the given string and assigns it to the Hostname field.
|
||||
func (o *Relay) SetHostname(v string) {
|
||||
o.Hostname = &v
|
||||
}
|
||||
|
||||
// GetLocation returns the Location field value if set, zero value otherwise.
|
||||
func (o *Relay) GetLocation() string {
|
||||
if o == nil || IsNil(o.Location) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Location
|
||||
}
|
||||
|
||||
// GetLocationOk returns a tuple with the Location field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Relay) GetLocationOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Location) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Location, true
|
||||
}
|
||||
|
||||
// HasLocation returns a boolean if a field has been set.
|
||||
func (o *Relay) HasLocation() bool {
|
||||
if o != nil && !IsNil(o.Location) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLocation gets a reference to the given string and assigns it to the Location field.
|
||||
func (o *Relay) SetLocation(v string) {
|
||||
o.Location = &v
|
||||
}
|
||||
|
||||
// GetActive returns the Active field value if set, zero value otherwise.
|
||||
func (o *Relay) 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 *Relay) 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 *Relay) 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 *Relay) SetActive(v bool) {
|
||||
o.Active = &v
|
||||
}
|
||||
|
||||
// GetOwned returns the Owned field value if set, zero value otherwise.
|
||||
func (o *Relay) GetOwned() bool {
|
||||
if o == nil || IsNil(o.Owned) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.Owned
|
||||
}
|
||||
|
||||
// GetOwnedOk returns a tuple with the Owned field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Relay) GetOwnedOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.Owned) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Owned, true
|
||||
}
|
||||
|
||||
// HasOwned returns a boolean if a field has been set.
|
||||
func (o *Relay) HasOwned() bool {
|
||||
if o != nil && !IsNil(o.Owned) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOwned gets a reference to the given bool and assigns it to the Owned field.
|
||||
func (o *Relay) SetOwned(v bool) {
|
||||
o.Owned = &v
|
||||
}
|
||||
|
||||
// GetProvider returns the Provider field value if set, zero value otherwise.
|
||||
func (o *Relay) GetProvider() string {
|
||||
if o == nil || IsNil(o.Provider) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Provider
|
||||
}
|
||||
|
||||
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Relay) GetProviderOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Provider) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Provider, true
|
||||
}
|
||||
|
||||
// HasProvider returns a boolean if a field has been set.
|
||||
func (o *Relay) HasProvider() bool {
|
||||
if o != nil && !IsNil(o.Provider) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetProvider gets a reference to the given string and assigns it to the Provider field.
|
||||
func (o *Relay) SetProvider(v string) {
|
||||
o.Provider = &v
|
||||
}
|
||||
|
||||
// GetIpv4AddrIn returns the Ipv4AddrIn field value if set, zero value otherwise.
|
||||
func (o *Relay) GetIpv4AddrIn() string {
|
||||
if o == nil || IsNil(o.Ipv4AddrIn) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Ipv4AddrIn
|
||||
}
|
||||
|
||||
// GetIpv4AddrInOk returns a tuple with the Ipv4AddrIn field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Relay) GetIpv4AddrInOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Ipv4AddrIn) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Ipv4AddrIn, true
|
||||
}
|
||||
|
||||
// HasIpv4AddrIn returns a boolean if a field has been set.
|
||||
func (o *Relay) HasIpv4AddrIn() bool {
|
||||
if o != nil && !IsNil(o.Ipv4AddrIn) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetIpv4AddrIn gets a reference to the given string and assigns it to the Ipv4AddrIn field.
|
||||
func (o *Relay) SetIpv4AddrIn(v string) {
|
||||
o.Ipv4AddrIn = &v
|
||||
}
|
||||
|
||||
// GetIncludeInCountry returns the IncludeInCountry field value if set, zero value otherwise.
|
||||
func (o *Relay) GetIncludeInCountry() bool {
|
||||
if o == nil || IsNil(o.IncludeInCountry) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.IncludeInCountry
|
||||
}
|
||||
|
||||
// GetIncludeInCountryOk returns a tuple with the IncludeInCountry field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Relay) GetIncludeInCountryOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.IncludeInCountry) {
|
||||
return nil, false
|
||||
}
|
||||
return o.IncludeInCountry, true
|
||||
}
|
||||
|
||||
// HasIncludeInCountry returns a boolean if a field has been set.
|
||||
func (o *Relay) HasIncludeInCountry() bool {
|
||||
if o != nil && !IsNil(o.IncludeInCountry) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetIncludeInCountry gets a reference to the given bool and assigns it to the IncludeInCountry field.
|
||||
func (o *Relay) SetIncludeInCountry(v bool) {
|
||||
o.IncludeInCountry = &v
|
||||
}
|
||||
|
||||
// GetWeight returns the Weight field value if set, zero value otherwise.
|
||||
func (o *Relay) GetWeight() int32 {
|
||||
if o == nil || IsNil(o.Weight) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.Weight
|
||||
}
|
||||
|
||||
// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Relay) GetWeightOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.Weight) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Weight, true
|
||||
}
|
||||
|
||||
// HasWeight returns a boolean if a field has been set.
|
||||
func (o *Relay) HasWeight() bool {
|
||||
if o != nil && !IsNil(o.Weight) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetWeight gets a reference to the given int32 and assigns it to the Weight field.
|
||||
func (o *Relay) SetWeight(v int32) {
|
||||
o.Weight = &v
|
||||
}
|
||||
|
||||
func (o Relay) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o Relay) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Hostname) {
|
||||
toSerialize["hostname"] = o.Hostname
|
||||
}
|
||||
if !IsNil(o.Location) {
|
||||
toSerialize["location"] = o.Location
|
||||
}
|
||||
if !IsNil(o.Active) {
|
||||
toSerialize["active"] = o.Active
|
||||
}
|
||||
if !IsNil(o.Owned) {
|
||||
toSerialize["owned"] = o.Owned
|
||||
}
|
||||
if !IsNil(o.Provider) {
|
||||
toSerialize["provider"] = o.Provider
|
||||
}
|
||||
if !IsNil(o.Ipv4AddrIn) {
|
||||
toSerialize["ipv4_addr_in"] = o.Ipv4AddrIn
|
||||
}
|
||||
if !IsNil(o.IncludeInCountry) {
|
||||
toSerialize["include_in_country"] = o.IncludeInCountry
|
||||
}
|
||||
if !IsNil(o.Weight) {
|
||||
toSerialize["weight"] = o.Weight
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableRelay struct {
|
||||
value *Relay
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableRelay) Get() *Relay {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableRelay) Set(val *Relay) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableRelay) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableRelay) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableRelay(val *Relay) *NullableRelay {
|
||||
return &NullableRelay{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableRelay) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableRelay) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
238
pkg/mullvad_api/model_wire_guard_pubkey.go
Normal file
238
pkg/mullvad_api/model_wire_guard_pubkey.go
Normal file
@ -0,0 +1,238 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the WireGuardPubkey type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &WireGuardPubkey{}
|
||||
|
||||
// WireGuardPubkey struct for WireGuardPubkey
|
||||
type WireGuardPubkey struct {
|
||||
// Convenience field with the public key encoded to use with the API (eg when deleting it), same as the pubkey field but urlencoded.
|
||||
Id *string `json:"id,omitempty"`
|
||||
// The WireGuard public key.
|
||||
Pubkey *string `json:"pubkey,omitempty"`
|
||||
// The ipv4 peer adress for WireGuard. Note that the mask may be bigger then a single IP.
|
||||
Ipv4Address *string `json:"ipv4_address,omitempty"`
|
||||
// The ipv6 peer address for WireGuard. Note that the mask may be bigger then a single IP.
|
||||
Ipv6Address *string `json:"ipv6_address,omitempty"`
|
||||
}
|
||||
|
||||
// NewWireGuardPubkey instantiates a new WireGuardPubkey 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 NewWireGuardPubkey() *WireGuardPubkey {
|
||||
this := WireGuardPubkey{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewWireGuardPubkeyWithDefaults instantiates a new WireGuardPubkey 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 NewWireGuardPubkeyWithDefaults() *WireGuardPubkey {
|
||||
this := WireGuardPubkey{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetId returns the Id field value if set, zero value otherwise.
|
||||
func (o *WireGuardPubkey) GetId() string {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Id
|
||||
}
|
||||
|
||||
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WireGuardPubkey) GetIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Id, true
|
||||
}
|
||||
|
||||
// HasId returns a boolean if a field has been set.
|
||||
func (o *WireGuardPubkey) HasId() bool {
|
||||
if o != nil && !IsNil(o.Id) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetId gets a reference to the given string and assigns it to the Id field.
|
||||
func (o *WireGuardPubkey) SetId(v string) {
|
||||
o.Id = &v
|
||||
}
|
||||
|
||||
// GetPubkey returns the Pubkey field value if set, zero value otherwise.
|
||||
func (o *WireGuardPubkey) GetPubkey() string {
|
||||
if o == nil || IsNil(o.Pubkey) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Pubkey
|
||||
}
|
||||
|
||||
// GetPubkeyOk returns a tuple with the Pubkey field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WireGuardPubkey) GetPubkeyOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Pubkey) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Pubkey, true
|
||||
}
|
||||
|
||||
// HasPubkey returns a boolean if a field has been set.
|
||||
func (o *WireGuardPubkey) HasPubkey() bool {
|
||||
if o != nil && !IsNil(o.Pubkey) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPubkey gets a reference to the given string and assigns it to the Pubkey field.
|
||||
func (o *WireGuardPubkey) SetPubkey(v string) {
|
||||
o.Pubkey = &v
|
||||
}
|
||||
|
||||
// GetIpv4Address returns the Ipv4Address field value if set, zero value otherwise.
|
||||
func (o *WireGuardPubkey) GetIpv4Address() string {
|
||||
if o == nil || IsNil(o.Ipv4Address) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Ipv4Address
|
||||
}
|
||||
|
||||
// GetIpv4AddressOk returns a tuple with the Ipv4Address field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WireGuardPubkey) GetIpv4AddressOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Ipv4Address) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Ipv4Address, true
|
||||
}
|
||||
|
||||
// HasIpv4Address returns a boolean if a field has been set.
|
||||
func (o *WireGuardPubkey) HasIpv4Address() bool {
|
||||
if o != nil && !IsNil(o.Ipv4Address) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetIpv4Address gets a reference to the given string and assigns it to the Ipv4Address field.
|
||||
func (o *WireGuardPubkey) SetIpv4Address(v string) {
|
||||
o.Ipv4Address = &v
|
||||
}
|
||||
|
||||
// GetIpv6Address returns the Ipv6Address field value if set, zero value otherwise.
|
||||
func (o *WireGuardPubkey) GetIpv6Address() string {
|
||||
if o == nil || IsNil(o.Ipv6Address) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Ipv6Address
|
||||
}
|
||||
|
||||
// GetIpv6AddressOk returns a tuple with the Ipv6Address field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WireGuardPubkey) GetIpv6AddressOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Ipv6Address) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Ipv6Address, true
|
||||
}
|
||||
|
||||
// HasIpv6Address returns a boolean if a field has been set.
|
||||
func (o *WireGuardPubkey) HasIpv6Address() bool {
|
||||
if o != nil && !IsNil(o.Ipv6Address) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetIpv6Address gets a reference to the given string and assigns it to the Ipv6Address field.
|
||||
func (o *WireGuardPubkey) SetIpv6Address(v string) {
|
||||
o.Ipv6Address = &v
|
||||
}
|
||||
|
||||
func (o WireGuardPubkey) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o WireGuardPubkey) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Id) {
|
||||
toSerialize["id"] = o.Id
|
||||
}
|
||||
if !IsNil(o.Pubkey) {
|
||||
toSerialize["pubkey"] = o.Pubkey
|
||||
}
|
||||
if !IsNil(o.Ipv4Address) {
|
||||
toSerialize["ipv4_address"] = o.Ipv4Address
|
||||
}
|
||||
if !IsNil(o.Ipv6Address) {
|
||||
toSerialize["ipv6_address"] = o.Ipv6Address
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableWireGuardPubkey struct {
|
||||
value *WireGuardPubkey
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableWireGuardPubkey) Get() *WireGuardPubkey {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableWireGuardPubkey) Set(val *WireGuardPubkey) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableWireGuardPubkey) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableWireGuardPubkey) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableWireGuardPubkey(val *WireGuardPubkey) *NullableWireGuardPubkey {
|
||||
return &NullableWireGuardPubkey{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableWireGuardPubkey) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableWireGuardPubkey) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
532
pkg/mullvad_api/model_wire_guard_relay.go
Normal file
532
pkg/mullvad_api/model_wire_guard_relay.go
Normal file
@ -0,0 +1,532 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the WireGuardRelay type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &WireGuardRelay{}
|
||||
|
||||
// WireGuardRelay struct for WireGuardRelay
|
||||
type WireGuardRelay struct {
|
||||
Hostname *string `json:"hostname,omitempty"`
|
||||
Location *string `json:"location,omitempty"`
|
||||
Active *bool `json:"active,omitempty"`
|
||||
Owned *bool `json:"owned,omitempty"`
|
||||
Provider *string `json:"provider,omitempty"`
|
||||
Ipv4AddrIn *string `json:"ipv4_addr_in,omitempty"`
|
||||
IncludeInCountry *bool `json:"include_in_country,omitempty"`
|
||||
Weight *int32 `json:"weight,omitempty"`
|
||||
PublicKey *string `json:"public_key,omitempty"`
|
||||
Ipv6AddrIn *string `json:"ipv6_addr_in,omitempty"`
|
||||
// Whether the server supports clients using the same IP address. This flag will be removed once all servers support the feature, so clients should default to True if it's missing.
|
||||
SameIp *bool `json:"same_ip,omitempty"`
|
||||
// If true, clients can expect DAITA to be available on this relay. Note that this field is not guaranteed to be present. A missing `daita` property is semantically equivalent to `\"daita\": false`.
|
||||
Daita *bool `json:"daita,omitempty"`
|
||||
}
|
||||
|
||||
// NewWireGuardRelay instantiates a new WireGuardRelay 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 NewWireGuardRelay() *WireGuardRelay {
|
||||
this := WireGuardRelay{}
|
||||
var sameIp bool = true
|
||||
this.SameIp = &sameIp
|
||||
var daita bool = false
|
||||
this.Daita = &daita
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewWireGuardRelayWithDefaults instantiates a new WireGuardRelay 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 NewWireGuardRelayWithDefaults() *WireGuardRelay {
|
||||
this := WireGuardRelay{}
|
||||
var sameIp bool = true
|
||||
this.SameIp = &sameIp
|
||||
var daita bool = false
|
||||
this.Daita = &daita
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetHostname returns the Hostname field value if set, zero value otherwise.
|
||||
func (o *WireGuardRelay) GetHostname() string {
|
||||
if o == nil || IsNil(o.Hostname) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Hostname
|
||||
}
|
||||
|
||||
// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WireGuardRelay) GetHostnameOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Hostname) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Hostname, true
|
||||
}
|
||||
|
||||
// HasHostname returns a boolean if a field has been set.
|
||||
func (o *WireGuardRelay) HasHostname() bool {
|
||||
if o != nil && !IsNil(o.Hostname) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetHostname gets a reference to the given string and assigns it to the Hostname field.
|
||||
func (o *WireGuardRelay) SetHostname(v string) {
|
||||
o.Hostname = &v
|
||||
}
|
||||
|
||||
// GetLocation returns the Location field value if set, zero value otherwise.
|
||||
func (o *WireGuardRelay) GetLocation() string {
|
||||
if o == nil || IsNil(o.Location) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Location
|
||||
}
|
||||
|
||||
// GetLocationOk returns a tuple with the Location field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WireGuardRelay) GetLocationOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Location) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Location, true
|
||||
}
|
||||
|
||||
// HasLocation returns a boolean if a field has been set.
|
||||
func (o *WireGuardRelay) HasLocation() bool {
|
||||
if o != nil && !IsNil(o.Location) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLocation gets a reference to the given string and assigns it to the Location field.
|
||||
func (o *WireGuardRelay) SetLocation(v string) {
|
||||
o.Location = &v
|
||||
}
|
||||
|
||||
// GetActive returns the Active field value if set, zero value otherwise.
|
||||
func (o *WireGuardRelay) 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 *WireGuardRelay) 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 *WireGuardRelay) 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 *WireGuardRelay) SetActive(v bool) {
|
||||
o.Active = &v
|
||||
}
|
||||
|
||||
// GetOwned returns the Owned field value if set, zero value otherwise.
|
||||
func (o *WireGuardRelay) GetOwned() bool {
|
||||
if o == nil || IsNil(o.Owned) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.Owned
|
||||
}
|
||||
|
||||
// GetOwnedOk returns a tuple with the Owned field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WireGuardRelay) GetOwnedOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.Owned) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Owned, true
|
||||
}
|
||||
|
||||
// HasOwned returns a boolean if a field has been set.
|
||||
func (o *WireGuardRelay) HasOwned() bool {
|
||||
if o != nil && !IsNil(o.Owned) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOwned gets a reference to the given bool and assigns it to the Owned field.
|
||||
func (o *WireGuardRelay) SetOwned(v bool) {
|
||||
o.Owned = &v
|
||||
}
|
||||
|
||||
// GetProvider returns the Provider field value if set, zero value otherwise.
|
||||
func (o *WireGuardRelay) GetProvider() string {
|
||||
if o == nil || IsNil(o.Provider) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Provider
|
||||
}
|
||||
|
||||
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WireGuardRelay) GetProviderOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Provider) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Provider, true
|
||||
}
|
||||
|
||||
// HasProvider returns a boolean if a field has been set.
|
||||
func (o *WireGuardRelay) HasProvider() bool {
|
||||
if o != nil && !IsNil(o.Provider) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetProvider gets a reference to the given string and assigns it to the Provider field.
|
||||
func (o *WireGuardRelay) SetProvider(v string) {
|
||||
o.Provider = &v
|
||||
}
|
||||
|
||||
// GetIpv4AddrIn returns the Ipv4AddrIn field value if set, zero value otherwise.
|
||||
func (o *WireGuardRelay) GetIpv4AddrIn() string {
|
||||
if o == nil || IsNil(o.Ipv4AddrIn) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Ipv4AddrIn
|
||||
}
|
||||
|
||||
// GetIpv4AddrInOk returns a tuple with the Ipv4AddrIn field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WireGuardRelay) GetIpv4AddrInOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Ipv4AddrIn) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Ipv4AddrIn, true
|
||||
}
|
||||
|
||||
// HasIpv4AddrIn returns a boolean if a field has been set.
|
||||
func (o *WireGuardRelay) HasIpv4AddrIn() bool {
|
||||
if o != nil && !IsNil(o.Ipv4AddrIn) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetIpv4AddrIn gets a reference to the given string and assigns it to the Ipv4AddrIn field.
|
||||
func (o *WireGuardRelay) SetIpv4AddrIn(v string) {
|
||||
o.Ipv4AddrIn = &v
|
||||
}
|
||||
|
||||
// GetIncludeInCountry returns the IncludeInCountry field value if set, zero value otherwise.
|
||||
func (o *WireGuardRelay) GetIncludeInCountry() bool {
|
||||
if o == nil || IsNil(o.IncludeInCountry) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.IncludeInCountry
|
||||
}
|
||||
|
||||
// GetIncludeInCountryOk returns a tuple with the IncludeInCountry field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WireGuardRelay) GetIncludeInCountryOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.IncludeInCountry) {
|
||||
return nil, false
|
||||
}
|
||||
return o.IncludeInCountry, true
|
||||
}
|
||||
|
||||
// HasIncludeInCountry returns a boolean if a field has been set.
|
||||
func (o *WireGuardRelay) HasIncludeInCountry() bool {
|
||||
if o != nil && !IsNil(o.IncludeInCountry) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetIncludeInCountry gets a reference to the given bool and assigns it to the IncludeInCountry field.
|
||||
func (o *WireGuardRelay) SetIncludeInCountry(v bool) {
|
||||
o.IncludeInCountry = &v
|
||||
}
|
||||
|
||||
// GetWeight returns the Weight field value if set, zero value otherwise.
|
||||
func (o *WireGuardRelay) GetWeight() int32 {
|
||||
if o == nil || IsNil(o.Weight) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.Weight
|
||||
}
|
||||
|
||||
// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WireGuardRelay) GetWeightOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.Weight) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Weight, true
|
||||
}
|
||||
|
||||
// HasWeight returns a boolean if a field has been set.
|
||||
func (o *WireGuardRelay) HasWeight() bool {
|
||||
if o != nil && !IsNil(o.Weight) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetWeight gets a reference to the given int32 and assigns it to the Weight field.
|
||||
func (o *WireGuardRelay) SetWeight(v int32) {
|
||||
o.Weight = &v
|
||||
}
|
||||
|
||||
// GetPublicKey returns the PublicKey field value if set, zero value otherwise.
|
||||
func (o *WireGuardRelay) GetPublicKey() string {
|
||||
if o == nil || IsNil(o.PublicKey) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.PublicKey
|
||||
}
|
||||
|
||||
// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WireGuardRelay) GetPublicKeyOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.PublicKey) {
|
||||
return nil, false
|
||||
}
|
||||
return o.PublicKey, true
|
||||
}
|
||||
|
||||
// HasPublicKey returns a boolean if a field has been set.
|
||||
func (o *WireGuardRelay) HasPublicKey() bool {
|
||||
if o != nil && !IsNil(o.PublicKey) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPublicKey gets a reference to the given string and assigns it to the PublicKey field.
|
||||
func (o *WireGuardRelay) SetPublicKey(v string) {
|
||||
o.PublicKey = &v
|
||||
}
|
||||
|
||||
// GetIpv6AddrIn returns the Ipv6AddrIn field value if set, zero value otherwise.
|
||||
func (o *WireGuardRelay) GetIpv6AddrIn() string {
|
||||
if o == nil || IsNil(o.Ipv6AddrIn) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Ipv6AddrIn
|
||||
}
|
||||
|
||||
// GetIpv6AddrInOk returns a tuple with the Ipv6AddrIn field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WireGuardRelay) GetIpv6AddrInOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Ipv6AddrIn) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Ipv6AddrIn, true
|
||||
}
|
||||
|
||||
// HasIpv6AddrIn returns a boolean if a field has been set.
|
||||
func (o *WireGuardRelay) HasIpv6AddrIn() bool {
|
||||
if o != nil && !IsNil(o.Ipv6AddrIn) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetIpv6AddrIn gets a reference to the given string and assigns it to the Ipv6AddrIn field.
|
||||
func (o *WireGuardRelay) SetIpv6AddrIn(v string) {
|
||||
o.Ipv6AddrIn = &v
|
||||
}
|
||||
|
||||
// GetSameIp returns the SameIp field value if set, zero value otherwise.
|
||||
func (o *WireGuardRelay) GetSameIp() bool {
|
||||
if o == nil || IsNil(o.SameIp) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.SameIp
|
||||
}
|
||||
|
||||
// GetSameIpOk returns a tuple with the SameIp field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WireGuardRelay) GetSameIpOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.SameIp) {
|
||||
return nil, false
|
||||
}
|
||||
return o.SameIp, true
|
||||
}
|
||||
|
||||
// HasSameIp returns a boolean if a field has been set.
|
||||
func (o *WireGuardRelay) HasSameIp() bool {
|
||||
if o != nil && !IsNil(o.SameIp) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetSameIp gets a reference to the given bool and assigns it to the SameIp field.
|
||||
func (o *WireGuardRelay) SetSameIp(v bool) {
|
||||
o.SameIp = &v
|
||||
}
|
||||
|
||||
// GetDaita returns the Daita field value if set, zero value otherwise.
|
||||
func (o *WireGuardRelay) GetDaita() bool {
|
||||
if o == nil || IsNil(o.Daita) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.Daita
|
||||
}
|
||||
|
||||
// GetDaitaOk returns a tuple with the Daita field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *WireGuardRelay) GetDaitaOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.Daita) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Daita, true
|
||||
}
|
||||
|
||||
// HasDaita returns a boolean if a field has been set.
|
||||
func (o *WireGuardRelay) HasDaita() bool {
|
||||
if o != nil && !IsNil(o.Daita) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDaita gets a reference to the given bool and assigns it to the Daita field.
|
||||
func (o *WireGuardRelay) SetDaita(v bool) {
|
||||
o.Daita = &v
|
||||
}
|
||||
|
||||
func (o WireGuardRelay) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o WireGuardRelay) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Hostname) {
|
||||
toSerialize["hostname"] = o.Hostname
|
||||
}
|
||||
if !IsNil(o.Location) {
|
||||
toSerialize["location"] = o.Location
|
||||
}
|
||||
if !IsNil(o.Active) {
|
||||
toSerialize["active"] = o.Active
|
||||
}
|
||||
if !IsNil(o.Owned) {
|
||||
toSerialize["owned"] = o.Owned
|
||||
}
|
||||
if !IsNil(o.Provider) {
|
||||
toSerialize["provider"] = o.Provider
|
||||
}
|
||||
if !IsNil(o.Ipv4AddrIn) {
|
||||
toSerialize["ipv4_addr_in"] = o.Ipv4AddrIn
|
||||
}
|
||||
if !IsNil(o.IncludeInCountry) {
|
||||
toSerialize["include_in_country"] = o.IncludeInCountry
|
||||
}
|
||||
if !IsNil(o.Weight) {
|
||||
toSerialize["weight"] = o.Weight
|
||||
}
|
||||
if !IsNil(o.PublicKey) {
|
||||
toSerialize["public_key"] = o.PublicKey
|
||||
}
|
||||
if !IsNil(o.Ipv6AddrIn) {
|
||||
toSerialize["ipv6_addr_in"] = o.Ipv6AddrIn
|
||||
}
|
||||
if !IsNil(o.SameIp) {
|
||||
toSerialize["same_ip"] = o.SameIp
|
||||
}
|
||||
if !IsNil(o.Daita) {
|
||||
toSerialize["daita"] = o.Daita
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableWireGuardRelay struct {
|
||||
value *WireGuardRelay
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableWireGuardRelay) Get() *WireGuardRelay {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableWireGuardRelay) Set(val *WireGuardRelay) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableWireGuardRelay) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableWireGuardRelay) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableWireGuardRelay(val *WireGuardRelay) *NullableWireGuardRelay {
|
||||
return &NullableWireGuardRelay{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableWireGuardRelay) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableWireGuardRelay) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
47
pkg/mullvad_api/response.go
Normal file
47
pkg/mullvad_api/response.go
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
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
|
||||
}
|
186
pkg/mullvad_api/test/api_default_test.go
Normal file
186
pkg/mullvad_api/test/api_default_test.go
Normal file
@ -0,0 +1,186 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
Testing DefaultAPIService
|
||||
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech);
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"testing"
|
||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/mullvad_api"
|
||||
)
|
||||
|
||||
func Test_mullvad_api_DefaultAPIService(t *testing.T) {
|
||||
|
||||
configuration := openapiclient.NewConfiguration()
|
||||
apiClient := openapiclient.NewAPIClient(configuration)
|
||||
|
||||
t.Run("Test DefaultAPIService V1AccountsPost", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
resp, httpRes, err := apiClient.DefaultAPI.V1AccountsPost(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test DefaultAPIService V1ApiAddrsGet", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
resp, httpRes, err := apiClient.DefaultAPI.V1ApiAddrsGet(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test DefaultAPIService V1CreateApplePaymentPost", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
resp, httpRes, err := apiClient.DefaultAPI.V1CreateApplePaymentPost(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test DefaultAPIService V1MeGet", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
resp, httpRes, err := apiClient.DefaultAPI.V1MeGet(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test DefaultAPIService V1ProblemReportPost", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
httpRes, err := apiClient.DefaultAPI.V1ProblemReportPost(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test DefaultAPIService V1RelaysGet", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
resp, httpRes, err := apiClient.DefaultAPI.V1RelaysGet(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test DefaultAPIService V1ReleasesPlatformVersionGet", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
var platform string
|
||||
var version string
|
||||
|
||||
resp, httpRes, err := apiClient.DefaultAPI.V1ReleasesPlatformVersionGet(context.Background(), platform, version).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test DefaultAPIService V1ReplaceWireguardKeyPost", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
resp, httpRes, err := apiClient.DefaultAPI.V1ReplaceWireguardKeyPost(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test DefaultAPIService V1SubmitVoucherPost", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
resp, httpRes, err := apiClient.DefaultAPI.V1SubmitVoucherPost(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test DefaultAPIService V1WireguardKeysPost", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
resp, httpRes, err := apiClient.DefaultAPI.V1WireguardKeysPost(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test DefaultAPIService V1WireguardKeysPubkeyDelete", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
var pubkey string
|
||||
|
||||
httpRes, err := apiClient.DefaultAPI.V1WireguardKeysPubkeyDelete(context.Background(), pubkey).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test DefaultAPIService V1WireguardKeysPubkeyGet", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
var pubkey string
|
||||
|
||||
resp, httpRes, err := apiClient.DefaultAPI.V1WireguardKeysPubkeyGet(context.Background(), pubkey).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test DefaultAPIService V1WwwAuthTokenPost", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
resp, httpRes, err := apiClient.DefaultAPI.V1WwwAuthTokenPost(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
}
|
347
pkg/mullvad_api/utils.go
Normal file
347
pkg/mullvad_api/utils.go
Normal file
@ -0,0 +1,347 @@
|
||||
/*
|
||||
Mullvad App API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
API version: 1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package mullvad_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"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)
|
||||
}
|
39
pkg/mullvad_mgmt/Makefile
Normal file
39
pkg/mullvad_mgmt/Makefile
Normal file
@ -0,0 +1,39 @@
|
||||
PROTO_URL_BASE := "https://raw.githubusercontent.com/mullvad/mullvadvpn-app/main"
|
||||
PROTO_URL := "$(PROTO_URL_BASE)/mullvad-management-interface/proto/management_interface.proto"
|
||||
GET_PROTOC_GO_RPC = $(shell which protoc-gen-go-grpc)
|
||||
GET_PROTOC_GO_RPC = $(eval PROTOC_GO_RPC=$(GET_PROTOC_GO_RPC))
|
||||
|
||||
all :: clean dep fetch gen prune
|
||||
|
||||
dep ::
|
||||
if ! protoc --version 2>&1 > /dev/null; then echo -e \
|
||||
"\e[1;31m\n\nmissing protoc, can't generate management gRPC client\e[0m\n"; \
|
||||
return 1; \
|
||||
fi
|
||||
if ! command -v protoc-gen-go 2>&1 > /dev/null; then \
|
||||
go install -x google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 || return 1; \
|
||||
fi
|
||||
if ! command -v protoc-gen-go-grpc 2>&1 > /dev/null; then \
|
||||
go install -x google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2 || return 1; \
|
||||
fi
|
||||
|
||||
fetch :: dep
|
||||
mkdir -p proto
|
||||
curl "$(PROTO_URL)" -o proto/management_interface.proto
|
||||
sed -i '/package mullvad_daemon.management_interface;/a option go_package="git.tcp.direct/kayos/mully/pkg/mullvad_mgmt";' proto/management_interface.proto
|
||||
|
||||
gen ::
|
||||
protoc \
|
||||
--plugin="$(PROTOC_GO_RPC)" \
|
||||
-I ./proto \
|
||||
-I /usr/include \
|
||||
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
|
||||
--go_out=. --go_opt=paths=source_relative \
|
||||
management_interface.proto
|
||||
|
||||
prune ::
|
||||
rm -r proto 2>/dev/null || true
|
||||
|
||||
clean ::
|
||||
rm -r proto 2>/dev/null || true
|
||||
rm *.go 2>/dev/null || true
|
9639
pkg/mullvad_mgmt/management_interface.pb.go
Normal file
9639
pkg/mullvad_mgmt/management_interface.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
2643
pkg/mullvad_mgmt/management_interface_grpc.pb.go
Normal file
2643
pkg/mullvad_mgmt/management_interface_grpc.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user