diff --git a/.github/workflows/validation-massedcompute.yml b/.github/workflows/validation-massedcompute.yml new file mode 100644 index 0000000..ac1549c --- /dev/null +++ b/.github/workflows/validation-massedcompute.yml @@ -0,0 +1,49 @@ +name: Massed Compute Validation Tests + +on: + workflow_dispatch: + # Run explicitly from the Actions UI, GitHub CLI, or API. + +jobs: + massedcompute-validation: + name: Massed Compute Provider Validation + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: 'go.mod' + + - name: Cache Go modules + uses: actions/cache@v4 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: Install dependencies + run: make deps + + - name: Run Massed Compute validation tests + env: + MASSED_COMPUTE_API_TOKEN: ${{ secrets.MASSED_COMPUTE_API_TOKEN }} + TEST_PRIVATE_KEY_BASE64: ${{ secrets.TEST_PRIVATE_KEY_BASE64 }} + TEST_PUBLIC_KEY_BASE64: ${{ secrets.TEST_PUBLIC_KEY_BASE64 }} + VALIDATION_TEST: true + run: | + cd v1/providers/massedcompute + go test -v -short=false -timeout=30m ./... + + - name: Upload test results + uses: actions/upload-artifact@v4 + if: always() + with: + name: massedcompute-validation-results + path: | + v1/providers/massedcompute/coverage.out diff --git a/v1/providers/massedcompute/Makefile b/v1/providers/massedcompute/Makefile new file mode 100644 index 0000000..45fe715 --- /dev/null +++ b/v1/providers/massedcompute/Makefile @@ -0,0 +1,25 @@ +SPEC_VERSION ?= v1.0.0 +SPEC_FILE ?= openapi-${SPEC_VERSION}.yaml +SPEC_FILE_FINAL ?= openapi-${SPEC_VERSION}.final.yaml +SPEC_PATCH ?= openapi-${SPEC_VERSION}.patch +OUTPUT_DIR ?= massedcompute + +.PHONY: finalize-massedcompute-openapi generate-massedcompute-client +finalize-massedcompute-openapi: + cp ${SPEC_FILE} ${SPEC_FILE_FINAL} + patch -s -F 0 ${SPEC_FILE_FINAL} ${SPEC_PATCH} + +generate-massedcompute-client: finalize-massedcompute-openapi + rm -rf gen/${OUTPUT_DIR} + mkdir -p gen/${OUTPUT_DIR} + docker run --rm -v "${CURDIR}:/local" openapitools/openapi-generator-cli:v7.8.0 generate \ + --additional-properties disallowAdditionalPropertiesIfNotPresent=false \ + -i /local/${SPEC_FILE_FINAL} \ + -g go \ + --git-user-id brevdev \ + --git-repo-id cloud \ + -o /local/gen/${OUTPUT_DIR} + find gen/${OUTPUT_DIR} -name "*.go" -type f -exec sed -i.bak 's|openapiclient "github.com/brevdev/cloud"|openapiclient "github.com/brevdev/cloud/v1/providers/massedcompute/gen/massedcompute"|g' {} \; && find gen/${OUTPUT_DIR} -name "*.go.bak" -delete + find gen/${OUTPUT_DIR} -name "*.md" -type f -exec sed -i.bak 's/[[:space:]]*$$//' {} \; && find gen/${OUTPUT_DIR} -name "*.md.bak" -delete + gofmt -s -w gen/${OUTPUT_DIR} + rm -f gen/${OUTPUT_DIR}/go.mod gen/${OUTPUT_DIR}/go.sum diff --git a/v1/providers/massedcompute/README.md b/v1/providers/massedcompute/README.md new file mode 100644 index 0000000..080705a --- /dev/null +++ b/v1/providers/massedcompute/README.md @@ -0,0 +1,23 @@ +# Massed Compute Provider + +This package implements the minimal Brev Cloud v1 surface for Massed Compute. + +The SDK exposes and reports a single `massedcompute` location, which maps to the API's `any` launch region. + +## Generated API client + +The generated client is committed under `gen/massedcompute`. Regenerate it from the version-pinned Massed Compute OpenAPI specification with: + +```sh +make -C v1/providers/massedcompute generate-massedcompute-client +``` + +`openapi-v1.0.0.yaml` is the unmodified vendor specification. At generation time, the version-pinned `openapi-v1.0.0.patch` produces `openapi-v1.0.0.final.yaml` with the few repairs needed for strict validation: matching the single-instance operation to its actual `runningInstances` response envelope, declaring the omitted instance `{uuid}` parameter, correcting the launch request's required fields, relocating two request examples, and repairing two misplaced terminate-response fields. Patch application fails if a future vendor document no longer matches these exact locations. + +## Live validation + +Set `MASSED_COMPUTE_API_TOKEN` and optionally `MASSED_COMPUTE_API_URL`, then run: + +```sh +go test -run TestValidationFunctions ./v1/providers/massedcompute +``` diff --git a/v1/providers/massedcompute/bootstrap.go b/v1/providers/massedcompute/bootstrap.go new file mode 100644 index 0000000..c246016 --- /dev/null +++ b/v1/providers/massedcompute/bootstrap.go @@ -0,0 +1,145 @@ +package massedcompute + +import ( + "encoding/base64" + "fmt" + "net" + "strings" + + v1 "github.com/brevdev/cloud/v1" +) + +const ( + dockerFirewallScriptPath = "/usr/local/sbin/brev-apply-docker-firewall.sh" + dockerFirewallDropInPath = "/etc/systemd/system/docker.service.d/10-brev-firewall.conf" +) + +func buildStartupCommand(rules v1.FirewallRules) (string, error) { + script, err := buildStartupScript(rules) + if err != nil { + return "", err + } + encodedScript := base64.StdEncoding.EncodeToString([]byte(script)) + return "printf %s '" + encodedScript + "' | base64 --decode | sudo -n bash", nil +} + +func buildStartupScript(rules v1.FirewallRules) (string, error) { + ufwRules, dockerRules, err := firewallRuleCommands(rules.IngressRules) + if err != nil { + return "", err + } + + var script strings.Builder + script.WriteString(`#!/bin/bash +set -u + +passwd --lock ubuntu + +if ! command -v ufw >/dev/null 2>&1; then + apt-get update -y + DEBIAN_FRONTEND=noninteractive apt-get install -y ufw iptables +fi + +mkdir -p /usr/local/sbin /etc/systemd/system/docker.service.d +cat > ` + dockerFirewallScriptPath + ` <<'BREV_FIREWALL' +#!/bin/sh +iptables -N DOCKER-USER 2>/dev/null || true +iptables -F DOCKER-USER || true +iptables -A DOCKER-USER -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT +iptables -A DOCKER-USER -i docker0 ! -o docker0 -j ACCEPT +iptables -A DOCKER-USER -i br+ ! -o br+ -j ACCEPT +iptables -A DOCKER-USER -i cni+ ! -o cni+ -j ACCEPT +iptables -A DOCKER-USER -i cali+ ! -o cali+ -j ACCEPT +iptables -A DOCKER-USER -i docker0 -o docker0 -j ACCEPT +iptables -A DOCKER-USER -i br+ -o br+ -j ACCEPT +iptables -A DOCKER-USER -i cni+ -o cni+ -j ACCEPT +iptables -A DOCKER-USER -i cali+ -o cali+ -j ACCEPT +iptables -A DOCKER-USER -i lo -j ACCEPT +iptables -A DOCKER-USER -i wt0 -j ACCEPT +`) + for _, command := range dockerRules { + script.WriteString(command) + script.WriteByte('\n') + } + script.WriteString(`iptables -A DOCKER-USER -j DROP +exit 0 +BREV_FIREWALL +chmod 0755 ` + dockerFirewallScriptPath + ` + +cat > ` + dockerFirewallDropInPath + ` <<'BREV_DROP_IN' +[Service] +ExecStartPost=-` + dockerFirewallScriptPath + ` +BREV_DROP_IN + +systemctl daemon-reload || true +ufw --force reset +ufw default deny incoming +ufw default allow outgoing +ufw allow 22/tcp +`) + for _, command := range ufwRules { + script.WriteString(command) + script.WriteByte('\n') + } + script.WriteString(`ufw --force enable +` + dockerFirewallScriptPath + ` || true +`) + return script.String(), nil +} + +func firewallRuleCommands(rules []v1.FirewallRule) ([]string, []string, error) { + var ufwCommands []string + var dockerCommands []string + for _, rule := range rules { + if rule.FromPort < 1 || rule.ToPort > 65535 || rule.FromPort > rule.ToPort { + return nil, nil, fmt.Errorf("invalid firewall port range %d-%d", rule.FromPort, rule.ToPort) + } + + sources := rule.IPRanges + if len(sources) == 0 { + sources = []string{"0.0.0.0/0"} + } + for _, source := range sources { + ip, network, err := net.ParseCIDR(source) + if err != nil { + return nil, nil, fmt.Errorf("invalid firewall CIDR %q: %w", source, err) + } + if ip.To4() == nil { + return nil, nil, fmt.Errorf("IPv6 firewall CIDR %q is not supported", source) + } + source = network.String() + + if rule.FromPort == rule.ToPort { + ufwCommands = append(ufwCommands, fmt.Sprintf( + "ufw allow from %s to any port %d", + source, + rule.FromPort, + )) + } else { + for _, protocol := range []string{"tcp", "udp"} { + ufwCommands = append(ufwCommands, fmt.Sprintf( + "ufw allow from %s to any port %d:%d proto %s", + source, + rule.FromPort, + rule.ToPort, + protocol, + )) + } + } + + portSpec := fmt.Sprintf("%d", rule.FromPort) + if rule.FromPort != rule.ToPort { + portSpec = fmt.Sprintf("%d:%d", rule.FromPort, rule.ToPort) + } + for _, protocol := range []string{"tcp", "udp"} { + dockerCommands = append(dockerCommands, fmt.Sprintf( + "iptables -A DOCKER-USER -s %s -p %s --dport %s -j ACCEPT", + source, + protocol, + portSpec, + )) + } + } + } + return ufwCommands, dockerCommands, nil +} diff --git a/v1/providers/massedcompute/capabilities.go b/v1/providers/massedcompute/capabilities.go new file mode 100644 index 0000000..1ac9685 --- /dev/null +++ b/v1/providers/massedcompute/capabilities.go @@ -0,0 +1,19 @@ +package massedcompute + +import ( + "context" + + v1 "github.com/brevdev/cloud/v1" +) + +func getCapabilities() v1.Capabilities { + return v1.Capabilities{ + v1.CapabilityCreateInstance, + v1.CapabilityTerminateInstance, + v1.CapabilityCreateTerminateInstance, + } +} + +func (c *MassedComputeClient) GetCapabilities(_ context.Context) (v1.Capabilities, error) { + return getCapabilities(), nil +} diff --git a/v1/providers/massedcompute/client.go b/v1/providers/massedcompute/client.go new file mode 100644 index 0000000..5e239e8 --- /dev/null +++ b/v1/providers/massedcompute/client.go @@ -0,0 +1,156 @@ +package massedcompute + +import ( + "context" + "fmt" + "net/http" + "strings" + + validation "github.com/go-ozzo/ozzo-validation/v4" + "github.com/pkg/errors" + + v1 "github.com/brevdev/cloud/v1" + openapi "github.com/brevdev/cloud/v1/providers/massedcompute/gen/massedcompute" +) + +const ( + CloudProviderID = "massedcompute" + DefaultAPIURL = "https://vm.massedcompute.com/api/v1" + massedComputeLocation = "massedcompute" // Massed Compute does not support location selection, so report all locations as "massedcompute" + massedComputeRegion = "any" // The instance creation API expects 'any' as the region +) + +type MassedComputeCredential struct { + RefID string + APIToken string `json:"api_token"` + APIURL string `json:"api_url"` +} + +var _ v1.CloudCredential = &MassedComputeCredential{} + +func NewMassedComputeCredential(refID, apiToken string) *MassedComputeCredential { + credential := &MassedComputeCredential{ + RefID: refID, + APIToken: apiToken, + } + credential.SetDefaults() + return credential +} + +func (c *MassedComputeCredential) SetDefaults() { + if c.APIURL == "" { + c.APIURL = DefaultAPIURL + } + c.APIURL = strings.TrimRight(c.APIURL, "/") +} + +func (c *MassedComputeCredential) Validate() error { + c.SetDefaults() + if err := validation.ValidateStruct( + c, + validation.Field(&c.APIToken, validation.Required), + validation.Field(&c.APIURL, validation.Required), + ); err != nil { + return errors.Wrap(err, "failed to validate massed compute credential") + } + return nil +} + +func (c *MassedComputeCredential) GetReferenceID() string { + return c.RefID +} + +func (c *MassedComputeCredential) GetAPIType() v1.APIType { + return v1.APITypeGlobal +} + +func (c *MassedComputeCredential) GetCloudProviderID() v1.CloudProviderID { + return CloudProviderID +} + +func (c *MassedComputeCredential) GetTenantID() (string, error) { + return makeTenantID(c.APIToken) +} + +func makeTenantID(apiToken string) (string, error) { + hashedToken, err := v1.HashSensitiveString(apiToken) + if err != nil { + return "", errors.Wrap(err, "failed to hash massed compute API token") + } + return fmt.Sprintf("%s-%s", CloudProviderID, hashedToken), nil +} + +func (c *MassedComputeCredential) MakeClient(ctx context.Context, location string) (v1.CloudClient, error) { + return c.MakeClientWithOptions(ctx, location) +} + +func (c *MassedComputeCredential) MakeClientWithOptions(_ context.Context, location string, opts ...MassedComputeClientOption) (v1.CloudClient, error) { + return NewMassedComputeClient(*c, location, opts...) +} + +func (c *MassedComputeCredential) GetCapabilities(_ context.Context) (v1.Capabilities, error) { + return getCapabilities(), nil +} + +type MassedComputeClient struct { + v1.NotImplCloudClient + + refID string + apiToken string + client *openapi.APIClient + httpClient *http.Client +} + +var _ v1.CloudClient = &MassedComputeClient{} + +type MassedComputeClientOption func(*MassedComputeClient) + +func WithHTTPClient(httpClient *http.Client) MassedComputeClientOption { + return func(c *MassedComputeClient) { + c.httpClient = httpClient + } +} + +func NewMassedComputeClient(credential MassedComputeCredential, _ string, opts ...MassedComputeClientOption) (*MassedComputeClient, error) { + if err := credential.Validate(); err != nil { + return nil, err + } + + client := &MassedComputeClient{ + refID: credential.RefID, + apiToken: credential.APIToken, + httpClient: http.DefaultClient, + } + for _, opt := range opts { + opt(client) + } + + configuration := openapi.NewConfiguration() + configuration.HTTPClient = client.httpClient + configuration.UserAgent = "brev-cloud" + configuration.Servers = []openapi.ServerConfiguration{{URL: credential.APIURL}} + configuration.AddDefaultHeader("Authorization", "Bearer "+credential.APIToken) + client.client = openapi.NewAPIClient(configuration) + + return client, nil +} + +func (c *MassedComputeClient) GetReferenceID() string { + return c.refID +} + +func (c *MassedComputeClient) GetAPIType() v1.APIType { + return v1.APITypeGlobal +} + +func (c *MassedComputeClient) GetCloudProviderID() v1.CloudProviderID { + return CloudProviderID +} + +func (c *MassedComputeClient) GetTenantID() (string, error) { + return makeTenantID(c.apiToken) +} + +func (c *MassedComputeClient) MakeClient(_ context.Context, _ string) (v1.CloudClient, error) { + return c, nil +} diff --git a/v1/providers/massedcompute/client_test.go b/v1/providers/massedcompute/client_test.go new file mode 100644 index 0000000..99e2162 --- /dev/null +++ b/v1/providers/massedcompute/client_test.go @@ -0,0 +1,559 @@ +package massedcompute + +import ( + "context" + "encoding/json" + "errors" + "net/http" + "net/http/httptest" + "testing" + + "github.com/alecthomas/units" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + v1 "github.com/brevdev/cloud/v1" + openapi "github.com/brevdev/cloud/v1/providers/massedcompute/gen/massedcompute" +) + +const testSSHPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBdptDTzJ2cOmdyryG1B7yb1YssiCQs6SWu4HlbZXGE" + +func TestMassedComputeCredential(t *testing.T) { + credential := NewMassedComputeCredential("credential-ref", "api-token") + + assert.Equal(t, DefaultAPIURL, credential.APIURL) + assert.Equal(t, v1.CloudProviderID(CloudProviderID), credential.GetCloudProviderID()) + assert.Equal(t, v1.APITypeGlobal, credential.GetAPIType()) + assert.Equal(t, "credential-ref", credential.GetReferenceID()) + require.NoError(t, credential.Validate()) + + tenantID, err := credential.GetTenantID() + require.NoError(t, err) + assert.NotEmpty(t, tenantID) + + invalid := NewMassedComputeCredential("credential-ref", "") + require.Error(t, invalid.Validate()) +} + +func TestGetInstanceTypesAndLocations(t *testing.T) { //nolint:funlen // test ok + server := newMassedComputeTestServer(t, func(w http.ResponseWriter, r *http.Request) { + require.Equal(t, "/gpu-inventory", r.URL.Path) + writeMassedComputeJSON(t, w, map[string]any{ + "gpu_inventory": map[string]any{ + "gpu_1x_l40": map[string]any{ + "instance_type": map[string]any{ + "name": "gpu_1x_l40", + "description": "1x L40 (48GB)", + "price_cents_per_hour": 86, + "specs": map[string]any{ + "vcpu_count": 14, + "memory_gib": 72, + "storage_gb": 625, + }, + }, + "regions_with_capacity_available": []map[string]any{{ + "name": "us-central-1", + "description": "Wichita, KS", + }}, + "capacity_available": 19, + }, + "gpu_4x_h200_nvl_nvlink_discount": map[string]any{ + "instance_type": map[string]any{ + "name": "gpu_4x_h200_nvl_nvlink_discount", + "description": "4x H200 NVL (141GB) NVLink [Spot]", + "price_cents_per_hour": 78, + "specs": map[string]any{ + "vcpu_count": 14, + "memory_gib": 72, + "storage_gb": 625, + }, + }, + "regions_with_capacity_available": []map[string]any{{"name": "spot-only-1"}}, + "capacity_available": 19, + }, + "gpu_1x_a6000_high_ram": map[string]any{ + "instance_type": map[string]any{ + "name": "gpu_1x_a6000_high_ram", + "description": "1x RTX A6000 (48GB) [Premium]", + "price_cents_per_hour": 125, + "specs": map[string]any{ + "vcpu_count": 32, + "memory_gib": 256, + "storage_gb": 1000, + }, + }, + "regions_with_capacity_available": []map[string]any{{"name": "us-central-1"}}, + }, + "gpu_1x_a6000_low_ram": map[string]any{ + "instance_type": map[string]any{ + "name": "gpu_1x_a6000_low_ram", + "description": "1x RTX A6000 (48GB) [ALT Config]", + "price_cents_per_hour": 95, + "specs": map[string]any{ + "vcpu_count": 20, + "memory_gib": 128, + "storage_gb": 750, + }, + }, + "regions_with_capacity_available": []map[string]any{{"name": "us-central-1"}}, + }, + "gpu_4x_h100_nvl_nvlink": map[string]any{ + "instance_type": map[string]any{ + "name": "gpu_4x_h100_nvl_nvlink", + "description": "4x H100 NVL", + "specs": map[string]any{}, + }, + "regions_with_capacity_available": []map[string]any{{"name": "us-central-1"}}, + }, + "gpu_8x_DGX_A100": map[string]any{ + "instance_type": map[string]any{ + "name": "gpu_8x_DGX_A100", + "description": "8x DGX A100 (80GB)", + "specs": map[string]any{}, + }, + "regions_with_capacity_available": []map[string]any{{"name": "us-central-1"}}, + }, + "gpu_1x_A100_SXM4": map[string]any{ + "instance_type": map[string]any{ + "name": "gpu_1x_A100_SXM4", + "description": "1x A100 SXM4 (80GB)", + "specs": map[string]any{}, + }, + "regions_with_capacity_available": []map[string]any{{"name": "us-central-1"}}, + }, + "cpu_small_amd_epyc": map[string]any{ + "instance_type": map[string]any{ + "name": "cpu_small_amd_epyc", + "description": "CPU-only instance", + "specs": map[string]any{ + "vcpu_count": 4, + "memory_gib": 16, + "storage_gb": 250, + }, + }, + "regions_with_capacity_available": []map[string]any{{"name": "us-central-1"}}, + }, + "gpu_2x_a6000_nvlink": map[string]any{ + "instance_type": map[string]any{ + "name": "gpu_2x_a6000_nvlink", + "description": "2x RTX A6000 (48GB) NVLink", + "specs": map[string]any{}, + }, + "regions_with_capacity_available": []map[string]any{{"name": "us-central-1"}}, + }, + "gpu_1x_a5000": map[string]any{ + "instance_type": map[string]any{ + "name": "gpu_1x_a5000", + "description": "1x RTX A5000 (24GB)", + "specs": map[string]any{}, + }, + "regions_with_capacity_available": []map[string]any{}, + "capacity_available": 0, + }, + }, + }) + }) + defer server.Close() + + client := newMassedComputeTestClient(t, server, "") + ctx := context.Background() + instanceTypes, err := client.GetInstanceTypes(ctx, v1.GetInstanceTypeArgs{}) + require.NoError(t, err) + require.Len(t, instanceTypes, 9) + instanceTypesByName := make(map[string]v1.InstanceType, len(instanceTypes)) + for _, instanceType := range instanceTypes { + instanceTypesByName[instanceType.Type] = instanceType + } + + instanceType, ok := instanceTypesByName["gpu_1x_l40"] + require.True(t, ok) + assert.Equal(t, "gpu_1x_l40", instanceType.Type) + assert.Equal(t, massedComputeLocation, instanceType.Location) + assert.Equal(t, v1.NewBytes(72, v1.Gibibyte), instanceType.MemoryBytes) + assertLegacyBytesMatch(t, instanceType.Memory, instanceType.MemoryBytes) + require.Len(t, instanceType.SupportedStorage, 1) + assert.Equal(t, v1.NewBytes(625, v1.Gigabyte), instanceType.SupportedStorage[0].SizeBytes) + assertLegacyBytesMatch(t, instanceType.SupportedStorage[0].Size, instanceType.SupportedStorage[0].SizeBytes) + require.Len(t, instanceType.SupportedGPUs, 1) + assert.Equal(t, int32(1), instanceType.SupportedGPUs[0].Count) + assert.Equal(t, "L40", instanceType.SupportedGPUs[0].Name) + assert.Equal(t, v1.NewBytes(48, v1.Gigabyte), instanceType.SupportedGPUs[0].MemoryBytes) + assert.Equal(t, []string{"on-demand"}, instanceType.SupportedUsageClasses) + assert.False(t, instanceType.Preemptible) + assert.Equal(t, "0.86", instanceType.BasePrice.Number()) + + nvlInstanceType, ok := instanceTypesByName["gpu_4x_h100_nvl_nvlink"] + require.True(t, ok) + require.Len(t, nvlInstanceType.SupportedGPUs, 1) + assert.Equal(t, int32(4), nvlInstanceType.SupportedGPUs[0].Count) + assert.Equal(t, "H100", nvlInstanceType.SupportedGPUs[0].Name) + assert.Equal(t, "H100", nvlInstanceType.SupportedGPUs[0].Type) + assert.Equal(t, v1.NewBytes(94, v1.Gigabyte), nvlInstanceType.SupportedGPUs[0].MemoryBytes) + assert.Equal(t, "NVLink", nvlInstanceType.SupportedGPUs[0].NetworkDetails) + + for _, test := range []struct { + typeName string + memoryGiB v1.BytesValue + vcpus int32 + storageGB v1.BytesValue + }{ + {typeName: "gpu_1x_a6000_high_ram", memoryGiB: 256, vcpus: 32, storageGB: 1000}, + {typeName: "gpu_1x_a6000_low_ram", memoryGiB: 128, vcpus: 20, storageGB: 750}, + } { + variant, ok := instanceTypesByName[test.typeName] + require.True(t, ok) + require.Len(t, variant.SupportedGPUs, 1) + assert.Equal(t, "RTX A6000", variant.SupportedGPUs[0].Name) + assert.Equal(t, v1.NewBytes(test.memoryGiB, v1.Gibibyte), variant.MemoryBytes) + assert.Equal(t, test.vcpus, variant.VCPU) + require.Len(t, variant.SupportedStorage, 1) + assert.Equal(t, v1.NewBytes(test.storageGB, v1.Gigabyte), variant.SupportedStorage[0].SizeBytes) + } + + dgxInstanceType, ok := instanceTypesByName["gpu_8x_DGX_A100"] + require.True(t, ok) + require.Len(t, dgxInstanceType.SupportedGPUs, 1) + assert.Equal(t, int32(8), dgxInstanceType.SupportedGPUs[0].Count) + assert.Equal(t, "DGX A100", dgxInstanceType.SupportedGPUs[0].Name) + assert.Equal(t, "DGX A100", dgxInstanceType.SupportedGPUs[0].Type) + + sxmInstanceType, ok := instanceTypesByName["gpu_1x_A100_SXM4"] + require.True(t, ok) + require.Len(t, sxmInstanceType.SupportedGPUs, 1) + assert.Equal(t, "A100", sxmInstanceType.SupportedGPUs[0].Name) + assert.Equal(t, "A100", sxmInstanceType.SupportedGPUs[0].Type) + assert.Equal(t, "SXM4", sxmInstanceType.SupportedGPUs[0].NetworkDetails) + + cpuInstanceType, ok := instanceTypesByName["cpu_small_amd_epyc"] + require.True(t, ok) + assert.Empty(t, cpuInstanceType.SupportedGPUs) + assert.Equal(t, v1.NewBytes(16, v1.Gibibyte), cpuInstanceType.MemoryBytes) + assert.Equal(t, int32(4), cpuInstanceType.VCPU) + + nvlinkInstanceType, ok := instanceTypesByName["gpu_2x_a6000_nvlink"] + require.True(t, ok) + require.Len(t, nvlinkInstanceType.SupportedGPUs, 1) + assert.Equal(t, int32(2), nvlinkInstanceType.SupportedGPUs[0].Count) + assert.Equal(t, "RTX A6000", nvlinkInstanceType.SupportedGPUs[0].Name) + assert.Equal(t, "NVLink", nvlinkInstanceType.SupportedGPUs[0].NetworkDetails) + + unavailableInstanceType, ok := instanceTypesByName["gpu_1x_a5000"] + require.True(t, ok) + assert.False(t, unavailableInstanceType.IsAvailable) + assert.Equal(t, massedComputeLocation, unavailableInstanceType.Location) + + locations, err := client.GetLocations(ctx, v1.GetLocationsArgs{}) + require.NoError(t, err) + require.Len(t, locations, 1) + assert.Equal(t, massedComputeLocation, locations[0].Name) + assert.Equal(t, "Massed Compute", locations[0].Description) + assert.True(t, locations[0].Available) + + require.NoError(t, v1.ValidateGetLocations(ctx, client)) + require.NoError(t, v1.ValidateGetInstanceTypes(ctx, client)) + require.NoError(t, v1.ValidateLocationalInstanceTypes(ctx, client)) +} + +func TestGPUVRAMFallback(t *testing.T) { + for _, test := range []struct { + description string + count int32 + model string + networkDetails string + memoryGB v1.BytesValue + }{ + {description: "1x H100 NVL", count: 1, model: "H100", networkDetails: "NVLink", memoryGB: 94}, + {description: "8x B200 SXM6", count: 8, model: "B200", networkDetails: "SXM6", memoryGB: 180}, + {description: "8x B300 SXM6", count: 8, model: "B300", networkDetails: "SXM6", memoryGB: 288}, + {description: "4x H100 NVL (80GB)", count: 4, model: "H100", networkDetails: "NVLink", memoryGB: 80}, + } { + t.Run(test.description, func(t *testing.T) { + gpus := massedComputeGPUs(test.description) + require.Len(t, gpus, 1) + assert.Equal(t, test.count, gpus[0].Count) + assert.Equal(t, test.model, gpus[0].Name) + assert.Equal(t, test.networkDetails, gpus[0].NetworkDetails) + assert.Equal(t, v1.NewBytes(test.memoryGB, v1.Gigabyte), gpus[0].MemoryBytes) + }) + } + + assert.Empty(t, massedComputeGPUs("CPU-only instance")) +} + +func TestCreateInstanceMapsLocationToAutomaticRegion(t *testing.T) { + var createdKey openapi.SshKeysPostRequest + var launchRequest openapi.InstanceLaunchPostRequest + server := newMassedComputeTestServer(t, func(w http.ResponseWriter, r *http.Request) { + assert.Equal(t, "Bearer api-token", r.Header.Get("Authorization")) + switch { + case r.Method == http.MethodGet && r.URL.Path == "/images": + writeMassedComputeJSON(t, w, map[string]any{"images": []map[string]any{{ + "vm_image_id": 42, "vm_image_name": "Ubuntu Server 22.04 w/ drivers", + }}}) + case r.Method == http.MethodGet && r.URL.Path == "/ssh-keys": + writeMassedComputeJSON(t, w, map[string]any{"sshKeys": []any{}}) + case r.Method == http.MethodPost && r.URL.Path == "/ssh-keys": + require.NoError(t, json.NewDecoder(r.Body).Decode(&createdKey)) + writeMassedComputeJSON(t, w, map[string]any{"sshKey": map[string]any{ + "id": "key-id", "name": createdKey.Name, + }}) + case r.Method == http.MethodPost && r.URL.Path == "/instance/launch": + require.NoError(t, json.NewDecoder(r.Body).Decode(&launchRequest)) + writeMassedComputeJSON(t, w, map[string]any{"response": "instance-id"}) + case r.Method == http.MethodGet && r.URL.Path == "/instance/instance-id": + writeMassedComputeJSON(t, w, map[string]any{"runningInstances": []map[string]any{{ + "uuid": "instance-id", + "name": "dev_tagged-credential_ref-123", + "status": "rented", + "username": "ubuntu", + "region": map[string]any{"name": "actual-region"}, + "image": map[string]any{"id": 42, "name": "Ubuntu Server 22.04 w/ drivers"}, + "product": map[string]any{"name": "gpu_1x_l40"}, + }}}) + default: + http.NotFound(w, r) + } + }) + defer server.Close() + + client := newMassedComputeTestClient(t, server, "client-region") + instance, err := client.CreateInstance(context.Background(), v1.CreateInstanceAttrs{ + RefID: "ref-123", + Name: "dev-environment", + InstanceType: "gpu_1x_l40", + Location: massedComputeLocation, + PublicKey: testSSHPublicKey, + Tags: v1.Tags{ + "dev-plane-stage": "dev", + "dev-plane-x-cloudCredId": "tagged-credential", + }, + }) + require.NoError(t, err) + + assert.Equal(t, "brevkey ref123", createdKey.Name) + assert.Equal(t, testSSHPublicKey, createdKey.PublicKey) + assert.Equal(t, massedComputeRegion, launchRequest.RegionName) + assert.Equal(t, "gpu_1x_l40", launchRequest.ProductName) + assert.Equal(t, []string{"brevkey ref123"}, launchRequest.SshKeys) + assert.Equal(t, int32(42), launchRequest.ImageId) + require.NotNil(t, launchRequest.Command) + assert.Contains(t, *launchRequest.Command, "base64 --decode | sudo -n bash") + require.NotNil(t, launchRequest.InstanceName) + assert.Equal(t, "dev_tagged-credential_ref-123", *launchRequest.InstanceName) + + assert.Equal(t, v1.CloudProviderInstanceID("instance-id"), instance.CloudID) + assert.Equal(t, massedComputeLocation, instance.Location) + assert.Equal(t, v1.InstanceTypeID("massedcompute-noSub-gpu_1x_l40"), instance.InstanceTypeID) + assert.Equal(t, "Ubuntu Server 22.04 w/ drivers", instance.ImageID) + assert.Equal(t, "ref-123", instance.RefID) + assert.Equal(t, "ref-123", instance.Name) + assert.Equal(t, "tagged-credential", instance.CloudCredRefID) + assert.Equal(t, "dev", instance.Tags["dev-plane-stage"]) + assert.Equal(t, "tagged-credential", instance.Tags["dev-plane-x-cloudCredId"]) + assert.False(t, instance.Spot) +} + +func TestProviderInstanceName(t *testing.T) { + providerName := makeProviderInstanceName("dev", "credential-ref", "ref-123") + assert.Equal(t, "dev_credential-ref_ref-123", providerName) + + stage, cloudCredRefID, refID, err := parseProviderInstanceName(providerName) + require.NoError(t, err) + assert.Equal(t, "dev", stage) + assert.Equal(t, "credential-ref", cloudCredRefID) + assert.Equal(t, "ref-123", refID) +} + +func TestResolveImageIDHonorsNumericOverride(t *testing.T) { + server := newMassedComputeTestServer(t, func(http.ResponseWriter, *http.Request) { + t.Error("numeric image IDs should not require an image catalog request") + }) + defer server.Close() + + client := newMassedComputeTestClient(t, server, "") + imageID, err := client.resolveImageID(context.Background(), "73") + require.NoError(t, err) + assert.Equal(t, int32(73), imageID) +} + +func TestResolveImageName(t *testing.T) { + server := newMassedComputeTestServer(t, func(w http.ResponseWriter, r *http.Request) { + require.Equal(t, http.MethodGet, r.Method) + require.Equal(t, "/images", r.URL.Path) + writeMassedComputeJSON(t, w, map[string]any{"images": []map[string]any{{ + "vm_image_id": 73, "vm_image_name": "Ubuntu Server 22.04 w/ drivers", + }}}) + }) + defer server.Close() + + client := newMassedComputeTestClient(t, server, "") + imageName, err := client.resolveImageName(context.Background(), 73) + require.NoError(t, err) + assert.Equal(t, "Ubuntu Server 22.04 w/ drivers", imageName) +} + +func TestListGetAndTerminateInstance(t *testing.T) { + var terminateRequest openapi.InstanceRestartPostRequest + server := newMassedComputeTestServer(t, func(w http.ResponseWriter, r *http.Request) { + switch { + case r.Method == http.MethodGet && r.URL.Path == "/instance": + writeMassedComputeJSON(t, w, map[string]any{"runningInstances": []map[string]any{{ + "uuid": "instance-id", + "name": "dev_creator-credential_ref-123", + "ip": "192.0.2.10", + "status": "rented", + "username": "ubuntu", + "created": "2026-08-25T12:34:56.000Z", + "region": map[string]any{"name": "us-central-1"}, + "image": map[string]any{"id": 42, "name": "Ubuntu Server 22.04 w/ drivers"}, + "product": map[string]any{ + "name": "gpu_1x_l40", "vcpu": 14, "ram": 72, "storage": 625, + }, + }}}) + case r.Method == http.MethodGet && r.URL.Path == "/instance/instance-id": + writeMassedComputeJSON(t, w, map[string]any{"runningInstances": []map[string]any{{ + "uuid": "instance-id", + "name": "dev_creator-credential_ref-123", + "ip": "192.0.2.10", + "status": "rented", + "username": "ubuntu", + "created": "2026-08-25T12:34:56.000Z", + "region": map[string]any{"name": "us-central-1"}, + "image": map[string]any{"id": 42, "name": "Ubuntu Server 22.04 w/ drivers"}, + "product": map[string]any{ + "name": "gpu_1x_l40", "vcpu": 14, "ram": 72, "storage": 625, + }, + }}}) + case r.Method == http.MethodPost && r.URL.Path == "/instance/terminate": + require.NoError(t, json.NewDecoder(r.Body).Decode(&terminateRequest)) + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusAccepted) + require.NoError(t, json.NewEncoder(w).Encode(map[string]any{"response": map[string]any{"data": map[string]any{"terminated_instances": []any{}}}})) + default: + http.NotFound(w, r) + } + }) + defer server.Close() + + client := newMassedComputeTestClient(t, server, "") + ctx := context.Background() + instances, err := client.ListInstances(ctx, v1.ListInstancesArgs{ + InstanceIDs: []v1.CloudProviderInstanceID{"instance-id"}, + Locations: v1.LocationsFilter{massedComputeLocation}, + }) + require.NoError(t, err) + require.Len(t, instances, 1) + instance := instances[0] + assert.Equal(t, "ref-123", instance.RefID) + assert.Equal(t, "ref-123", instance.Name) + assert.Equal(t, "creator-credential", instance.CloudCredRefID) + assert.Equal(t, v1.LifecycleStatusRunning, instance.Status.LifecycleStatus) + assert.Equal(t, "ubuntu", instance.SSHUser) + assert.Equal(t, "Ubuntu Server 22.04 w/ drivers", instance.ImageID) + assert.Equal(t, massedComputeLocation, instance.Location) + assert.Equal(t, v1.InstanceTypeID("massedcompute-noSub-gpu_1x_l40"), instance.InstanceTypeID) + assert.Equal(t, 22, instance.SSHPort) + assert.Equal(t, "ssd", instance.VolumeType) + assert.Equal(t, v1.NewBytes(625, v1.Gigabyte), instance.DiskSizeBytes) + assertLegacyBytesMatch(t, instance.DiskSize, instance.DiskSizeBytes) + + got, err := client.GetInstance(ctx, "instance-id") + require.NoError(t, err) + assert.Equal(t, instance.CloudID, got.CloudID) + assert.Equal(t, instance.DiskSizeBytes, got.DiskSizeBytes) + assert.Equal(t, instance.Location, got.Location) + + require.NoError(t, client.TerminateInstance(ctx, "instance-id")) + assert.Equal(t, []string{"instance-id"}, terminateRequest.InstanceUuids) +} + +func TestBuildStartupScript(t *testing.T) { + script, err := buildStartupScript(v1.FirewallRules{ + IngressRules: []v1.FirewallRule{{ + FromPort: 8080, + ToPort: 8081, + IPRanges: []string{"192.0.2.7/24"}, + }}, + }) + require.NoError(t, err) + + assert.Contains(t, script, "passwd --lock ubuntu") + assert.NotContains(t, script, "authorized_keys") + assert.NotContains(t, script, "useradd") + assert.Contains(t, script, "ufw allow from 192.0.2.0/24 to any port 8080:8081 proto tcp") + assert.Contains(t, script, "iptables -A DOCKER-USER -s 192.0.2.0/24 -p tcp --dport 8080:8081 -j ACCEPT") +} + +func TestBuildStartupScriptRejectsUnsafeRules(t *testing.T) { + _, err := buildStartupScript(v1.FirewallRules{ + IngressRules: []v1.FirewallRule{{ + FromPort: 9999, + ToPort: 9999, + IPRanges: []string{"not-a-cidr"}, + }}, + }) + require.Error(t, err) +} + +func TestSpotIsNotSupported(t *testing.T) { + server := newMassedComputeTestServer(t, func(http.ResponseWriter, *http.Request) { + t.Error("spot validation should fail before making an API request") + }) + defer server.Close() + + client := newMassedComputeTestClient(t, server, "us-central-1") + _, err := client.CreateInstance(context.Background(), v1.CreateInstanceAttrs{ + RefID: "ref-123", + InstanceType: "gpu_1x_l40_spot", + PublicKey: testSSHPublicKey, + }) + require.ErrorContains(t, err, "spot instances are not supported") + + _, err = client.CreateInstance(context.Background(), v1.CreateInstanceAttrs{ + RefID: "ref-123", + InstanceType: "gpu_1x_l40", + PublicKey: testSSHPublicKey, + UseSpot: true, + }) + require.ErrorContains(t, err, "spot instances are not supported") + + capabilities, err := client.GetCapabilities(context.Background()) + require.NoError(t, err) + assert.False(t, capabilities.IsCapable(v1.CapabilityStopStartInstance)) +} + +func newMassedComputeTestServer(t *testing.T, handler http.HandlerFunc) *httptest.Server { + t.Helper() + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + assert.Equal(t, "Bearer api-token", r.Header.Get("Authorization")) + handler(w, r) + })) +} + +func newMassedComputeTestClient(t *testing.T, server *httptest.Server, location string) *MassedComputeClient { + t.Helper() + credential := NewMassedComputeCredential("credential-ref", "api-token") + credential.APIURL = server.URL + client, err := NewMassedComputeClient(*credential, location, WithHTTPClient(server.Client())) + require.NoError(t, err) + return client +} + +func writeMassedComputeJSON(t *testing.T, w http.ResponseWriter, value any) { + t.Helper() + w.Header().Set("Content-Type", "application/json") + require.NoError(t, json.NewEncoder(w).Encode(value)) +} + +func assertLegacyBytesMatch(t *testing.T, legacy units.Base2Bytes, size v1.Bytes) { + t.Helper() + assert.Equal(t, size.ByteCount().Int64(), int64(legacy)) +} + +func TestWrapMassedComputeError(t *testing.T) { + err := wrapMassedComputeError(errors.New("no capacity available"), &http.Response{StatusCode: http.StatusConflict}) + require.ErrorIs(t, err, v1.ErrInsufficientResources) + + err = wrapMassedComputeError(errors.New("temporary failure"), &http.Response{StatusCode: http.StatusServiceUnavailable}) + require.ErrorIs(t, err, v1.ErrServiceUnavailable) +} diff --git a/v1/providers/massedcompute/errors.go b/v1/providers/massedcompute/errors.go new file mode 100644 index 0000000..d6a1480 --- /dev/null +++ b/v1/providers/massedcompute/errors.go @@ -0,0 +1,40 @@ +package massedcompute + +import ( + "errors" + "fmt" + "net/http" + "strings" + + v1 "github.com/brevdev/cloud/v1" + openapi "github.com/brevdev/cloud/v1/providers/massedcompute/gen/massedcompute" +) + +func wrapMassedComputeError(err error, response *http.Response) error { + if err == nil { + return nil + } + + message := err.Error() + var apiError *openapi.GenericOpenAPIError + if errors.As(err, &apiError) { + message += " " + string(apiError.Body()) + } + lowerMessage := strings.ToLower(message) + + statusCode := 0 + if response != nil { + statusCode = response.StatusCode + } + + switch { + case statusCode == http.StatusTooManyRequests || statusCode >= http.StatusInternalServerError: + return fmt.Errorf("massed compute API request failed: %w", errors.Join(v1.ErrServiceUnavailable, err)) + case strings.Contains(lowerMessage, "capacity") || strings.Contains(lowerMessage, "out of stock"): + return fmt.Errorf("massed compute API request failed: %w", errors.Join(v1.ErrInsufficientResources, err)) + case strings.Contains(lowerMessage, "quota") || strings.Contains(lowerMessage, "limit exceeded"): + return fmt.Errorf("massed compute API request failed: %w", errors.Join(v1.ErrOutOfQuota, err)) + default: + return fmt.Errorf("massed compute API request failed: %w", err) + } +} diff --git a/v1/providers/massedcompute/gen/massedcompute/.gitignore b/v1/providers/massedcompute/gen/massedcompute/.gitignore new file mode 100644 index 0000000..daf913b --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/v1/providers/massedcompute/gen/massedcompute/.openapi-generator-ignore b/v1/providers/massedcompute/gen/massedcompute/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/v1/providers/massedcompute/gen/massedcompute/.openapi-generator/FILES b/v1/providers/massedcompute/gen/massedcompute/.openapi-generator/FILES new file mode 100644 index 0000000..d34039d --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/.openapi-generator/FILES @@ -0,0 +1,107 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +api_account.go +api_coupon.go +api_default.go +api_instances.go +api_ssh_keys.go +client.go +configuration.go +docs/AccountAPI.md +docs/AccountTokenValidationPost200Response.md +docs/CouponAPI.md +docs/CouponInformationPostRequest.md +docs/DefaultAPI.md +docs/GPUInventoryV1.md +docs/GPUInventoryV1GpuInventoryValue.md +docs/GPUInventoryV1GpuInventoryValueInstanceType.md +docs/GPUInventoryV1GpuInventoryValueInstanceTypeSpecs.md +docs/GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner.md +docs/ImagesV1.md +docs/ImagesV1ImagesInner.md +docs/InstanceLaunchPost202Response.md +docs/InstanceLaunchPostRequest.md +docs/InstanceRestartPostRequest.md +docs/InstancesAPI.md +docs/POSTSSHKey.md +docs/POSTSSHKeySshKey.md +docs/RestartInstanceV1.md +docs/RestartInstanceV1ResponseInner.md +docs/RestartInstanceV1ResponseInnerInstanceType.md +docs/RestartInstanceV1ResponseInnerInstanceTypeSpecs.md +docs/RestartInstanceV1ResponseInnerRegion.md +docs/RetrieveAcceptProductsV1.md +docs/RetrieveAcceptProductsV1CouponValidation.md +docs/RetrieveAcceptProductsV1CouponValidationProductDetailsInner.md +docs/RetrieveAllRunningInstancesV1.md +docs/RetrieveAllRunningInstancesV1RunningInstancesInner.md +docs/RetrieveAllRunningInstancesV1RunningInstancesInnerImage.md +docs/RetrieveAllRunningInstancesV1RunningInstancesInnerProduct.md +docs/RetrieveBillingInformationV1.md +docs/RetrieveCouponInformationV1.md +docs/RetrieveCouponInformationV1Coupon.md +docs/RetrieveSingleRunningInstanceV1.md +docs/RetrieveSingleRunningInstanceV1RunningInstance.md +docs/RetrieveSingleRunningInstanceV1RunningInstanceProduct.md +docs/SSHKey.md +docs/SSHKeyItem.md +docs/SSHKeysAPI.md +docs/SshKeysIdDelete200Response.md +docs/SshKeysPostRequest.md +docs/TerminateInstanceV1.md +docs/TerminateInstanceV1Response.md +docs/TerminateInstanceV1ResponseData.md +docs/TerminateInstanceV1ResponseDataTerminatedInstancesInner.md +git_push.sh +go.mod +go.sum +model__account_token_validation_post_200_response.go +model__coupon_information_post_request.go +model__instance_launch_post_202_response.go +model__instance_launch_post_request.go +model__instance_restart_post_request.go +model__ssh_keys__id__delete_200_response.go +model__ssh_keys_post_request.go +model_gpu_inventory_v1.go +model_gpu_inventory_v1_gpu_inventory_value.go +model_gpu_inventory_v1_gpu_inventory_value_instance_type.go +model_gpu_inventory_v1_gpu_inventory_value_instance_type_specs.go +model_gpu_inventory_v1_gpu_inventory_value_regions_with_capacity_available_inner.go +model_images_v1.go +model_images_v1_images_inner.go +model_postssh_key.go +model_postssh_key_ssh_key.go +model_restart_instance_v1.go +model_restart_instance_v1_response_inner.go +model_restart_instance_v1_response_inner_instance_type.go +model_restart_instance_v1_response_inner_instance_type_specs.go +model_restart_instance_v1_response_inner_region.go +model_retrieve_accept_products_v1.go +model_retrieve_accept_products_v1_coupon_validation.go +model_retrieve_accept_products_v1_coupon_validation_product_details_inner.go +model_retrieve_all_running_instances_v1.go +model_retrieve_all_running_instances_v1_running_instances_inner.go +model_retrieve_all_running_instances_v1_running_instances_inner_image.go +model_retrieve_all_running_instances_v1_running_instances_inner_product.go +model_retrieve_billing_information_v1.go +model_retrieve_coupon_information_v1.go +model_retrieve_coupon_information_v1_coupon.go +model_retrieve_single_running_instance_v1.go +model_retrieve_single_running_instance_v1_running_instance.go +model_retrieve_single_running_instance_v1_running_instance_product.go +model_ssh_key.go +model_ssh_key_item.go +model_terminate_instance_v1.go +model_terminate_instance_v1_response.go +model_terminate_instance_v1_response_data.go +model_terminate_instance_v1_response_data_terminated_instances_inner.go +response.go +test/api_account_test.go +test/api_coupon_test.go +test/api_default_test.go +test/api_instances_test.go +test/api_ssh_keys_test.go +utils.go diff --git a/v1/providers/massedcompute/gen/massedcompute/.openapi-generator/VERSION b/v1/providers/massedcompute/gen/massedcompute/.openapi-generator/VERSION new file mode 100644 index 0000000..09a6d30 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0 diff --git a/v1/providers/massedcompute/gen/massedcompute/.travis.yml b/v1/providers/massedcompute/gen/massedcompute/.travis.yml new file mode 100644 index 0000000..f5cb2ce --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/v1/providers/massedcompute/gen/massedcompute/README.md b/v1/providers/massedcompute/gen/massedcompute/README.md new file mode 100644 index 0000000..a803bc8 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/README.md @@ -0,0 +1,176 @@ +# Go API client for openapi + +**API documentation for our direct on-demand offering** + +*If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* +# Authentication +Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. + +| Header | Value | +| --- | --- | +| Authorization | Bearer {{api_token}} | + +To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + + +## 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.0.0 +- Package version: 1.0.0 +- Generator version: 7.8.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```sh +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```go +import openapi "github.com/brevdev/cloud" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```go +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `openapi.ContextServerIndex` of type `int`. + +```go +ctx := context.WithValue(context.Background(), openapi.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `openapi.ContextServerVariables` of type `map[string]string`. + +```go +ctx := context.WithValue(context.Background(), openapi.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `openapi.ContextOperationServerIndices` and `openapi.ContextOperationServerVariables` context maps. + +```go +ctx := context.WithValue(context.Background(), openapi.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), openapi.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://vm.massedcompute.com/api/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AccountAPI* | [**AccountBillingGet**](docs/AccountAPI.md#accountbillingget) | **Get** /account/billing | Retrieve billing information. +*AccountAPI* | [**AccountTokenValidationPost**](docs/AccountAPI.md#accounttokenvalidationpost) | **Post** /account/token/validation | Validate an API token. +*CouponAPI* | [**CouponAcceptedProductsPost**](docs/CouponAPI.md#couponacceptedproductspost) | **Post** /coupon/accepted-products | Retrieve products that a coupon is valid for. +*CouponAPI* | [**CouponInformationPost**](docs/CouponAPI.md#couponinformationpost) | **Post** /coupon/information | Retrieve information about a coupon. +*DefaultAPI* | [**GpuInventoryGet**](docs/DefaultAPI.md#gpuinventoryget) | **Get** /gpu-inventory | Retrieve a list of avaialable GPU configurations. +*DefaultAPI* | [**ImagesGet**](docs/DefaultAPI.md#imagesget) | **Get** /images | Retrieve list of available images. +*InstancesAPI* | [**InstanceGet**](docs/InstancesAPI.md#instanceget) | **Get** /instance | Retrieve list of all running instances. +*InstancesAPI* | [**InstanceLaunchPost**](docs/InstancesAPI.md#instancelaunchpost) | **Post** /instance/launch | Deploy new instances. +*InstancesAPI* | [**InstanceRestartPost**](docs/InstancesAPI.md#instancerestartpost) | **Post** /instance/restart | Restart an instances. +*InstancesAPI* | [**InstanceTerminatePost**](docs/InstancesAPI.md#instanceterminatepost) | **Post** /instance/terminate | Terminate an instances. +*InstancesAPI* | [**InstanceUuidGet**](docs/InstancesAPI.md#instanceuuidget) | **Get** /instance/{uuid} | Retrieve single running instances. +*SSHKeysAPI* | [**SshKeysGet**](docs/SSHKeysAPI.md#sshkeysget) | **Get** /ssh-keys | Retrieve SSH keys associated with the account. +*SSHKeysAPI* | [**SshKeysIdDelete**](docs/SSHKeysAPI.md#sshkeysiddelete) | **Delete** /ssh-keys/{id} | Remove an SSH key from the account. +*SSHKeysAPI* | [**SshKeysPost**](docs/SSHKeysAPI.md#sshkeyspost) | **Post** /ssh-keys | Add an SSH key to the account. + + +## Documentation For Models + + - [AccountTokenValidationPost200Response](docs/AccountTokenValidationPost200Response.md) + - [CouponInformationPostRequest](docs/CouponInformationPostRequest.md) + - [GPUInventoryV1](docs/GPUInventoryV1.md) + - [GPUInventoryV1GpuInventoryValue](docs/GPUInventoryV1GpuInventoryValue.md) + - [GPUInventoryV1GpuInventoryValueInstanceType](docs/GPUInventoryV1GpuInventoryValueInstanceType.md) + - [GPUInventoryV1GpuInventoryValueInstanceTypeSpecs](docs/GPUInventoryV1GpuInventoryValueInstanceTypeSpecs.md) + - [GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner](docs/GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner.md) + - [ImagesV1](docs/ImagesV1.md) + - [ImagesV1ImagesInner](docs/ImagesV1ImagesInner.md) + - [InstanceLaunchPost202Response](docs/InstanceLaunchPost202Response.md) + - [InstanceLaunchPostRequest](docs/InstanceLaunchPostRequest.md) + - [InstanceRestartPostRequest](docs/InstanceRestartPostRequest.md) + - [POSTSSHKey](docs/POSTSSHKey.md) + - [POSTSSHKeySshKey](docs/POSTSSHKeySshKey.md) + - [RestartInstanceV1](docs/RestartInstanceV1.md) + - [RestartInstanceV1ResponseInner](docs/RestartInstanceV1ResponseInner.md) + - [RestartInstanceV1ResponseInnerInstanceType](docs/RestartInstanceV1ResponseInnerInstanceType.md) + - [RestartInstanceV1ResponseInnerInstanceTypeSpecs](docs/RestartInstanceV1ResponseInnerInstanceTypeSpecs.md) + - [RestartInstanceV1ResponseInnerRegion](docs/RestartInstanceV1ResponseInnerRegion.md) + - [RetrieveAcceptProductsV1](docs/RetrieveAcceptProductsV1.md) + - [RetrieveAcceptProductsV1CouponValidation](docs/RetrieveAcceptProductsV1CouponValidation.md) + - [RetrieveAcceptProductsV1CouponValidationProductDetailsInner](docs/RetrieveAcceptProductsV1CouponValidationProductDetailsInner.md) + - [RetrieveAllRunningInstancesV1](docs/RetrieveAllRunningInstancesV1.md) + - [RetrieveAllRunningInstancesV1RunningInstancesInner](docs/RetrieveAllRunningInstancesV1RunningInstancesInner.md) + - [RetrieveAllRunningInstancesV1RunningInstancesInnerImage](docs/RetrieveAllRunningInstancesV1RunningInstancesInnerImage.md) + - [RetrieveAllRunningInstancesV1RunningInstancesInnerProduct](docs/RetrieveAllRunningInstancesV1RunningInstancesInnerProduct.md) + - [RetrieveBillingInformationV1](docs/RetrieveBillingInformationV1.md) + - [RetrieveCouponInformationV1](docs/RetrieveCouponInformationV1.md) + - [RetrieveCouponInformationV1Coupon](docs/RetrieveCouponInformationV1Coupon.md) + - [RetrieveSingleRunningInstanceV1](docs/RetrieveSingleRunningInstanceV1.md) + - [RetrieveSingleRunningInstanceV1RunningInstance](docs/RetrieveSingleRunningInstanceV1RunningInstance.md) + - [RetrieveSingleRunningInstanceV1RunningInstanceProduct](docs/RetrieveSingleRunningInstanceV1RunningInstanceProduct.md) + - [SSHKey](docs/SSHKey.md) + - [SSHKeyItem](docs/SSHKeyItem.md) + - [SshKeysIdDelete200Response](docs/SshKeysIdDelete200Response.md) + - [SshKeysPostRequest](docs/SshKeysPostRequest.md) + - [TerminateInstanceV1](docs/TerminateInstanceV1.md) + - [TerminateInstanceV1Response](docs/TerminateInstanceV1Response.md) + - [TerminateInstanceV1ResponseData](docs/TerminateInstanceV1ResponseData.md) + - [TerminateInstanceV1ResponseDataTerminatedInstancesInner](docs/TerminateInstanceV1ResponseDataTerminatedInstancesInner.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/v1/providers/massedcompute/gen/massedcompute/api/openapi.yaml b/v1/providers/massedcompute/gen/massedcompute/api/openapi.yaml new file mode 100644 index 0000000..0e638db --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/api/openapi.yaml @@ -0,0 +1,1333 @@ +openapi: 3.0.0 +info: + description: | + **API documentation for our direct on-demand offering** + + *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* + # Authentication + Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. + + | Header | Value | + | --- | --- | + | Authorization | Bearer {{api_token}} | + + To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + title: Massed Compute VM API + version: 1.0.0 +servers: +- url: https://vm.massedcompute.com/api/v1 +paths: + /gpu-inventory: + get: + description: "An comprehensive list of all GPU types, configurations, and available\ + \ inventory." + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GPUInventoryV1' + description: A list of available GPUs + summary: Retrieve a list of avaialable GPU configurations. + /images: + get: + description: An Image is a preconfigured operating system and software stack. + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ImagesV1' + description: A list of available images + summary: Retrieve list of available images. + /instance: + get: + description: An instance is a virtual machine that is currently running. + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RetrieveAllRunningInstancesV1' + description: A list of all running instances + summary: Retrieve list of all running instances. + tags: + - Instances + /instance/{uuid}: + get: + description: An instance is a virtual machine that is currently running. + parameters: + - explode: false + in: path + name: uuid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RetrieveAllRunningInstancesV1' + description: A list of all running instances + summary: Retrieve single running instances. + tags: + - Instances + /instance/launch: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_instance_launch_post_request' + required: true + responses: + "202": + content: + application/json: + schema: + $ref: '#/components/schemas/_instance_launch_post_202_response' + description: Success deploying instance + summary: Deploy new instances. + tags: + - Instances + /instance/restart: + post: + requestBody: + content: + application/json: + example: + instanceUuids: + - string1 + - string2 + schema: + $ref: '#/components/schemas/_instance_restart_post_request' + required: true + responses: + "202": + content: + application/json: + schema: + $ref: '#/components/schemas/RestartInstanceV1' + description: Success restarting instance + summary: Restart an instances. + tags: + - Instances + /instance/terminate: + post: + description: Termination completely removes the instance from the system and + destroys all data. + requestBody: + content: + application/json: + example: + instanceUuids: + - string1 + - string2 + schema: + $ref: '#/components/schemas/_instance_restart_post_request' + required: true + responses: + "202": + content: + application/json: + schema: + $ref: '#/components/schemas/TerminateInstanceV1' + description: Success restarting instance + summary: Terminate an instances. + tags: + - Instances + /coupon/information: + post: + description: A coupon is a discount code that can be applied to an instance + when deployed. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_coupon_information_post_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RetrieveCouponInformationV1' + description: Success retrieving coupon information + summary: Retrieve information about a coupon. + tags: + - Coupon + /coupon/accepted-products: + post: + description: A coupon is a discount code that can be applied to an instance + when deployed. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_coupon_information_post_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RetrieveAcceptProductsV1' + description: Success retrieving coupon information + summary: Retrieve products that a coupon is valid for. + tags: + - Coupon + /account/token/validation: + post: + description: An API token is required to access the API. + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/_account_token_validation_post_200_response' + description: Success validating token + summary: Validate an API token. + tags: + - Account + /account/billing: + get: + description: Billing information for the account. + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RetrieveBillingInformationV1' + description: Success retrieving billing information + summary: Retrieve billing information. + tags: + - Account + /ssh-keys: + get: + description: An SSH key is a secure access credential used to connect to instances. + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SSHKey' + description: Success retrieving SSH keys + summary: Retrieve SSH keys associated with the account. + tags: + - SSH Keys + post: + description: An SSH key is a secure access credential used to connect to instances. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_ssh_keys_post_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/POSTSSHKey' + description: Success adding SSH key + summary: Add an SSH key to the account. + tags: + - SSH Keys + /ssh-keys/{id}: + delete: + description: An SSH key is a secure access credential used to connect to instances. + parameters: + - description: The unique identifier for the SSH key to be removed + explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/_ssh_keys__id__delete_200_response' + description: Success removing SSH key + summary: Remove an SSH key from the account. + tags: + - SSH Keys +components: + schemas: + GPUInventoryV1: + example: + gpu_inventory: + key: + regions_with_capacity_available: + - name: name + description: description + - name: name + description: description + capacity_available: 5 + instance_type: + specs: + vcpu_count: 6 + memory_gib: 1 + storage_gb: 5 + name: name + description: description + price_cents_per_hour: 0 + properties: + gpu_inventory: + additionalProperties: + $ref: '#/components/schemas/GPUInventoryV1_gpu_inventory_value' + type: object + type: object + ImagesV1: + example: + images: + - vm_image_description: vm_image_description + vm_image_name: vm_image_name + vm_image_id: 0 + - vm_image_description: vm_image_description + vm_image_name: vm_image_name + vm_image_id: 0 + properties: + images: + items: + $ref: '#/components/schemas/ImagesV1_images_inner' + type: array + type: object + RetrieveAllRunningInstancesV1: + example: + runningInstances: + - image: + name: Art + description: "AI-powered tools specifically designed for artists and creatives,\ + \ providing you with the ability to easily incorporate AI-generated\ + \ content into your work. By harnessing the power of these advanced\ + \ technologies, you can take your art to new heights and explore uncharted\ + \ territories in the creative world. Leverage the full potential of\ + \ AI and transform your artistic process today." + id: 7 + password: "123456" + os_booted: 1 + product: + gpu_count: 1 + vcpu: 26 + name: gpu_1x_l40 + description: 1x L40 + price_hr: "0.99" + final_price_hr: "0" + storage: 625 + ram: 128 + created: 2024-08-07T16:41:43.000Z + ip: 1.1.1.1 + command_startup: "" + name: Halloween Test + active: 1 + uuid: 8b52a46b-a892-4fde-925c-6d13226908f7 + username: Ubuntu + status: rented + - image: + name: Art + description: "AI-powered tools specifically designed for artists and creatives,\ + \ providing you with the ability to easily incorporate AI-generated\ + \ content into your work. By harnessing the power of these advanced\ + \ technologies, you can take your art to new heights and explore uncharted\ + \ territories in the creative world. Leverage the full potential of\ + \ AI and transform your artistic process today." + id: 7 + password: "123456" + os_booted: 1 + product: + gpu_count: 1 + vcpu: 26 + name: gpu_1x_l40 + description: 1x L40 + price_hr: "0.99" + final_price_hr: "0" + storage: 625 + ram: 128 + created: 2024-08-07T16:41:43.000Z + ip: 1.1.1.1 + command_startup: "" + name: Halloween Test + active: 1 + uuid: 8b52a46b-a892-4fde-925c-6d13226908f7 + username: Ubuntu + status: rented + properties: + runningInstances: + items: + $ref: '#/components/schemas/RetrieveAllRunningInstancesV1_runningInstances_inner' + type: array + type: object + RetrieveSingleRunningInstanceV1: + properties: + runningInstance: + $ref: '#/components/schemas/RetrieveSingleRunningInstanceV1_runningInstance' + type: object + RestartInstanceV1: + example: + response: + - file_system_names: + - file_system_names + - file_system_names + ip: 1.1.1.1 + name: test api deploy1 + id: 2c56cd01-5f0b-4bc2-bb72-3c8e486505e2 + region: + name: us-central-3 + description: "Des Moines, IA" + jupyter_url: jupyter_url + instance_type: + specs: + memory_gib: 48 + storage_gb: 256 + vcpus: 6 + name: gpu_1x_a6000 + description: 1x RTX A6000 + price_cents_per_hour: 0 + status: booting + ssh_key_names: + - ssh_key_names + - ssh_key_names + jupyter_token: jupyter_token + - file_system_names: + - file_system_names + - file_system_names + ip: 1.1.1.1 + name: test api deploy1 + id: 2c56cd01-5f0b-4bc2-bb72-3c8e486505e2 + region: + name: us-central-3 + description: "Des Moines, IA" + jupyter_url: jupyter_url + instance_type: + specs: + memory_gib: 48 + storage_gb: 256 + vcpus: 6 + name: gpu_1x_a6000 + description: 1x RTX A6000 + price_cents_per_hour: 0 + status: booting + ssh_key_names: + - ssh_key_names + - ssh_key_names + jupyter_token: jupyter_token + properties: + response: + items: + $ref: '#/components/schemas/RestartInstanceV1_response_inner' + type: array + type: object + TerminateInstanceV1: + example: + response: + data: + terminated_instances: + - file_system_names: + - file_system_names + - file_system_names + ip: 1.1.1.1 + name: test api deploy1 + id: 2c56cd01-5f0b-4bc2-bb72-3c8e486505e2 + region: + name: us-central-3 + description: "Des Moines, IA" + jupyter_url: "" + instance_type: + specs: + memory_gib: 48 + storage_gb: 256 + vcpus: 6 + name: gpu_1x_a6000 + description: 1x RTX A6000 + price_cents_per_hour: 0 + status: terminated + ssh_key_names: + - ssh_key_names + - ssh_key_names + jupyter_token: "" + - file_system_names: + - file_system_names + - file_system_names + ip: 1.1.1.1 + name: test api deploy1 + id: 2c56cd01-5f0b-4bc2-bb72-3c8e486505e2 + region: + name: us-central-3 + description: "Des Moines, IA" + jupyter_url: "" + instance_type: + specs: + memory_gib: 48 + storage_gb: 256 + vcpus: 6 + name: gpu_1x_a6000 + description: 1x RTX A6000 + price_cents_per_hour: 0 + status: terminated + ssh_key_names: + - ssh_key_names + - ssh_key_names + jupyter_token: "" + properties: + response: + $ref: '#/components/schemas/TerminateInstanceV1_response' + type: object + RetrieveCouponInformationV1: + example: + coupon: + deactivationDate: 2024-08-07T16:41:43.000Z + code: TestCoupon + discountPercent: "0.1" + properties: + coupon: + $ref: '#/components/schemas/RetrieveCouponInformationV1_coupon' + type: object + RetrieveAcceptProductsV1: + example: + couponValidation: + coupon: + deactivationDate: 2024-08-07T16:41:43.000Z + code: TestCoupon + discountPercent: "0.1" + productDetails: + - - name: gpu_1x_a6000 + description: 1x RTX A6000 + pricePerHour: "0.625000" + inventoryAvailable: true + - name: gpu_2x_a6000 + description: 2x RTX A6000 + pricePerHour: "1.250000" + inventoryAvailable: true + - name: gpu_4x_a6000 + description: 4x RTX A6000 + pricePerHour: "2.500000" + inventoryAvailable: true + - name: gpu_8x_a6000 + description: 8x RTX A6000 + pricePerHour: "5.000000" + inventoryAvailable: false + - - name: gpu_1x_a6000 + description: 1x RTX A6000 + pricePerHour: "0.625000" + inventoryAvailable: true + - name: gpu_2x_a6000 + description: 2x RTX A6000 + pricePerHour: "1.250000" + inventoryAvailable: true + - name: gpu_4x_a6000 + description: 4x RTX A6000 + pricePerHour: "2.500000" + inventoryAvailable: true + - name: gpu_8x_a6000 + description: 8x RTX A6000 + pricePerHour: "5.000000" + inventoryAvailable: false + properties: + couponValidation: + $ref: '#/components/schemas/RetrieveAcceptProductsV1_couponValidation' + type: object + RetrieveBillingInformationV1: + example: + rechargeAmount: "20" + billingMethod: creditcard + rechargeThreshold: "10" + rechargeAmountCents: 2000 + rechargeThresholdCents: 1000 + properties: + billingMethod: + example: creditcard + type: string + rechargeThresholdCents: + example: 1000 + type: integer + rechargeThreshold: + example: "10" + type: string + rechargeAmountCents: + example: 2000 + type: integer + rechargeAmount: + example: "20" + type: string + type: object + SSHKeyItem: + example: + public_key: public_key + name: name + id: id + properties: + id: + description: The unique identifier for the SSH key + type: string + name: + description: The name of the SSH key + type: string + public_key: + description: The public key associated with the SSH key + type: string + type: object + SSHKey: + example: + sshKeys: + - public_key: public_key + name: name + id: id + - public_key: public_key + name: name + id: id + properties: + sshKeys: + items: + $ref: '#/components/schemas/SSHKeyItem' + type: array + type: object + POSTSSHKey: + example: + sshKey: + name: name + id: id + properties: + sshKey: + $ref: '#/components/schemas/POSTSSHKey_sshKey' + type: object + _instance_launch_post_request: + properties: + imageId: + description: The ID of the image to deploy + type: integer + productName: + description: The product name of the GPU instance you want to deploy. Example + = 'gpu_1x_l40' + type: string + regionName: + description: Set value equal to 'any' + type: string + instanceName: + description: The name of the instance you want to deploy + type: string + coupon: + description: The coupon code you want to apply to the instance + type: string + command: + description: The command you want to run on startup + type: string + sshKeys: + description: The SSH key you want to use to connect to the instance + items: + type: string + type: array + required: + - imageId + - productName + - regionName + type: object + _instance_launch_post_202_response: + example: + response: 8b52a46b-uuid-4fde-xxxx-6d13226908f7 + properties: + response: + example: 8b52a46b-uuid-4fde-xxxx-6d13226908f7 + type: string + type: object + _instance_restart_post_request: + properties: + instanceUuids: + description: The ID or IDs of instances to restart + items: + type: string + type: array + required: + - instanceUuids + type: object + _coupon_information_post_request: + properties: + coupon: + description: The coupon code you want to retrieve information about + type: string + required: + - couponCode + type: object + _account_token_validation_post_200_response: + example: + message: Valid Token + properties: + message: + example: Valid Token + type: string + type: object + _ssh_keys_post_request: + properties: + name: + description: The name of the SSH key + type: string + publicKey: + description: The public key associated with the SSH key + type: string + required: + - name + - publicKey + type: object + _ssh_keys__id__delete_200_response: + example: + result: "{}" + properties: + result: + type: object + type: object + GPUInventoryV1_gpu_inventory_value_instance_type_specs: + example: + vcpu_count: 6 + memory_gib: 1 + storage_gb: 5 + properties: + vcpu_count: + type: integer + memory_gib: + type: integer + storage_gb: + type: integer + type: object + GPUInventoryV1_gpu_inventory_value_instance_type: + example: + specs: + vcpu_count: 6 + memory_gib: 1 + storage_gb: 5 + name: name + description: description + price_cents_per_hour: 0 + properties: + name: + type: string + description: + type: string + price_cents_per_hour: + type: integer + specs: + $ref: '#/components/schemas/GPUInventoryV1_gpu_inventory_value_instance_type_specs' + type: object + GPUInventoryV1_gpu_inventory_value_regions_with_capacity_available_inner: + example: + name: name + description: description + properties: + name: + type: string + description: + type: string + type: object + GPUInventoryV1_gpu_inventory_value: + example: + regions_with_capacity_available: + - name: name + description: description + - name: name + description: description + capacity_available: 5 + instance_type: + specs: + vcpu_count: 6 + memory_gib: 1 + storage_gb: 5 + name: name + description: description + price_cents_per_hour: 0 + properties: + instance_type: + $ref: '#/components/schemas/GPUInventoryV1_gpu_inventory_value_instance_type' + regions_with_capacity_available: + items: + $ref: '#/components/schemas/GPUInventoryV1_gpu_inventory_value_regions_with_capacity_available_inner' + type: array + capacity_available: + type: integer + type: object + ImagesV1_images_inner: + example: + vm_image_description: vm_image_description + vm_image_name: vm_image_name + vm_image_id: 0 + properties: + vm_image_id: + type: integer + vm_image_name: + type: string + vm_image_description: + type: string + type: object + RetrieveAllRunningInstancesV1_runningInstances_inner_image: + example: + name: Art + description: "AI-powered tools specifically designed for artists and creatives,\ + \ providing you with the ability to easily incorporate AI-generated content\ + \ into your work. By harnessing the power of these advanced technologies,\ + \ you can take your art to new heights and explore uncharted territories\ + \ in the creative world. Leverage the full potential of AI and transform\ + \ your artistic process today." + id: 7 + properties: + id: + example: 7 + type: integer + name: + example: Art + type: string + description: + example: "AI-powered tools specifically designed for artists and creatives,\ + \ providing you with the ability to easily incorporate AI-generated content\ + \ into your work. By harnessing the power of these advanced technologies,\ + \ you can take your art to new heights and explore uncharted territories\ + \ in the creative world. Leverage the full potential of AI and transform\ + \ your artistic process today." + type: string + type: object + RetrieveAllRunningInstancesV1_runningInstances_inner_product: + example: + gpu_count: 1 + vcpu: 26 + name: gpu_1x_l40 + description: 1x L40 + price_hr: "0.99" + final_price_hr: "0" + storage: 625 + ram: 128 + properties: + name: + example: gpu_1x_l40 + type: string + description: + example: 1x L40 + type: string + gpu_count: + example: 1 + type: integer + vcpu: + example: 26 + type: integer + ram: + example: 128 + type: integer + storage: + example: 625 + type: integer + price_hr: + example: "0.99" + type: string + final_price_hr: + example: "0" + type: string + type: object + RetrieveAllRunningInstancesV1_runningInstances_inner: + example: + image: + name: Art + description: "AI-powered tools specifically designed for artists and creatives,\ + \ providing you with the ability to easily incorporate AI-generated content\ + \ into your work. By harnessing the power of these advanced technologies,\ + \ you can take your art to new heights and explore uncharted territories\ + \ in the creative world. Leverage the full potential of AI and transform\ + \ your artistic process today." + id: 7 + password: "123456" + os_booted: 1 + product: + gpu_count: 1 + vcpu: 26 + name: gpu_1x_l40 + description: 1x L40 + price_hr: "0.99" + final_price_hr: "0" + storage: 625 + ram: 128 + created: 2024-08-07T16:41:43.000Z + ip: 1.1.1.1 + command_startup: "" + name: Halloween Test + active: 1 + uuid: 8b52a46b-a892-4fde-925c-6d13226908f7 + username: Ubuntu + status: rented + properties: + uuid: + example: 8b52a46b-a892-4fde-925c-6d13226908f7 + type: string + name: + example: Halloween Test + type: string + ip: + example: 1.1.1.1 + type: string + username: + example: Ubuntu + type: string + password: + example: "123456" + type: string + status: + example: rented + type: string + os_booted: + example: 1 + type: integer + command_startup: + example: "" + type: string + created: + example: 2024-08-07T16:41:43.000Z + type: string + active: + example: 1 + type: integer + image: + $ref: '#/components/schemas/RetrieveAllRunningInstancesV1_runningInstances_inner_image' + product: + $ref: '#/components/schemas/RetrieveAllRunningInstancesV1_runningInstances_inner_product' + type: object + RetrieveSingleRunningInstanceV1_runningInstance_product: + properties: + name: + example: gpu_1x_l40 + type: string + description: + example: 1x L40 + type: string + gpu_count: + example: 1 + type: integer + vcpu: + example: 26 + type: integer + ram: + example: 128 + type: integer + storage: + example: 625 + type: integer + price_hr: + example: "0.990000" + type: string + final_price_hr: + example: "0.000000" + type: string + type: object + RetrieveSingleRunningInstanceV1_runningInstance: + properties: + uuid: + example: 8b52a46b-a892-4fde-925c-6d13226908f7 + type: string + name: + example: Halloween Test + type: string + ip: + example: 1.1.1.1 + type: string + username: + example: Ubuntu + type: string + password: + example: "123456" + type: string + status: + example: rented + type: string + os_booted: + example: 1 + type: integer + command_startup: + example: "" + type: string + created: + example: 2024-08-07T16:41:43.000Z + type: string + active: + example: 1 + type: integer + image: + $ref: '#/components/schemas/RetrieveAllRunningInstancesV1_runningInstances_inner_image' + product: + $ref: '#/components/schemas/RetrieveSingleRunningInstanceV1_runningInstance_product' + type: object + RestartInstanceV1_response_inner_region: + example: + name: us-central-3 + description: "Des Moines, IA" + properties: + name: + example: us-central-3 + type: string + description: + example: "Des Moines, IA" + type: string + type: object + RestartInstanceV1_response_inner_instance_type_specs: + example: + memory_gib: 48 + storage_gb: 256 + vcpus: 6 + properties: + vcpus: + example: 6 + type: integer + memory_gib: + example: 48 + type: integer + storage_gb: + example: 256 + type: integer + type: object + RestartInstanceV1_response_inner_instance_type: + example: + specs: + memory_gib: 48 + storage_gb: 256 + vcpus: 6 + name: gpu_1x_a6000 + description: 1x RTX A6000 + price_cents_per_hour: 0 + properties: + name: + example: gpu_1x_a6000 + type: string + description: + example: 1x RTX A6000 + type: string + price_cents_per_hour: + example: 0 + type: integer + specs: + $ref: '#/components/schemas/RestartInstanceV1_response_inner_instance_type_specs' + type: object + RestartInstanceV1_response_inner: + example: + file_system_names: + - file_system_names + - file_system_names + ip: 1.1.1.1 + name: test api deploy1 + id: 2c56cd01-5f0b-4bc2-bb72-3c8e486505e2 + region: + name: us-central-3 + description: "Des Moines, IA" + jupyter_url: jupyter_url + instance_type: + specs: + memory_gib: 48 + storage_gb: 256 + vcpus: 6 + name: gpu_1x_a6000 + description: 1x RTX A6000 + price_cents_per_hour: 0 + status: booting + ssh_key_names: + - ssh_key_names + - ssh_key_names + jupyter_token: jupyter_token + properties: + id: + example: 2c56cd01-5f0b-4bc2-bb72-3c8e486505e2 + type: string + name: + example: test api deploy1 + type: string + ip: + example: 1.1.1.1 + type: string + status: + example: booting + type: string + ssh_key_names: + items: + type: string + type: array + file_system_names: + items: + type: string + type: array + region: + $ref: '#/components/schemas/RestartInstanceV1_response_inner_region' + instance_type: + $ref: '#/components/schemas/RestartInstanceV1_response_inner_instance_type' + jupyter_token: + type: string + jupyter_url: + type: string + type: object + TerminateInstanceV1_response_data_terminated_instances_inner: + example: + file_system_names: + - file_system_names + - file_system_names + ip: 1.1.1.1 + name: test api deploy1 + id: 2c56cd01-5f0b-4bc2-bb72-3c8e486505e2 + region: + name: us-central-3 + description: "Des Moines, IA" + jupyter_url: "" + instance_type: + specs: + memory_gib: 48 + storage_gb: 256 + vcpus: 6 + name: gpu_1x_a6000 + description: 1x RTX A6000 + price_cents_per_hour: 0 + status: terminated + ssh_key_names: + - ssh_key_names + - ssh_key_names + jupyter_token: "" + properties: + id: + example: 2c56cd01-5f0b-4bc2-bb72-3c8e486505e2 + type: string + name: + example: test api deploy1 + type: string + ip: + example: 1.1.1.1 + type: string + status: + example: terminated + type: string + ssh_key_names: + items: + type: string + type: array + file_system_names: + items: + type: string + type: array + region: + $ref: '#/components/schemas/RestartInstanceV1_response_inner_region' + instance_type: + $ref: '#/components/schemas/RestartInstanceV1_response_inner_instance_type' + jupyter_token: + example: "" + type: string + jupyter_url: + example: "" + type: string + type: object + TerminateInstanceV1_response_data: + example: + terminated_instances: + - file_system_names: + - file_system_names + - file_system_names + ip: 1.1.1.1 + name: test api deploy1 + id: 2c56cd01-5f0b-4bc2-bb72-3c8e486505e2 + region: + name: us-central-3 + description: "Des Moines, IA" + jupyter_url: "" + instance_type: + specs: + memory_gib: 48 + storage_gb: 256 + vcpus: 6 + name: gpu_1x_a6000 + description: 1x RTX A6000 + price_cents_per_hour: 0 + status: terminated + ssh_key_names: + - ssh_key_names + - ssh_key_names + jupyter_token: "" + - file_system_names: + - file_system_names + - file_system_names + ip: 1.1.1.1 + name: test api deploy1 + id: 2c56cd01-5f0b-4bc2-bb72-3c8e486505e2 + region: + name: us-central-3 + description: "Des Moines, IA" + jupyter_url: "" + instance_type: + specs: + memory_gib: 48 + storage_gb: 256 + vcpus: 6 + name: gpu_1x_a6000 + description: 1x RTX A6000 + price_cents_per_hour: 0 + status: terminated + ssh_key_names: + - ssh_key_names + - ssh_key_names + jupyter_token: "" + properties: + terminated_instances: + items: + $ref: '#/components/schemas/TerminateInstanceV1_response_data_terminated_instances_inner' + type: array + type: object + TerminateInstanceV1_response: + example: + data: + terminated_instances: + - file_system_names: + - file_system_names + - file_system_names + ip: 1.1.1.1 + name: test api deploy1 + id: 2c56cd01-5f0b-4bc2-bb72-3c8e486505e2 + region: + name: us-central-3 + description: "Des Moines, IA" + jupyter_url: "" + instance_type: + specs: + memory_gib: 48 + storage_gb: 256 + vcpus: 6 + name: gpu_1x_a6000 + description: 1x RTX A6000 + price_cents_per_hour: 0 + status: terminated + ssh_key_names: + - ssh_key_names + - ssh_key_names + jupyter_token: "" + - file_system_names: + - file_system_names + - file_system_names + ip: 1.1.1.1 + name: test api deploy1 + id: 2c56cd01-5f0b-4bc2-bb72-3c8e486505e2 + region: + name: us-central-3 + description: "Des Moines, IA" + jupyter_url: "" + instance_type: + specs: + memory_gib: 48 + storage_gb: 256 + vcpus: 6 + name: gpu_1x_a6000 + description: 1x RTX A6000 + price_cents_per_hour: 0 + status: terminated + ssh_key_names: + - ssh_key_names + - ssh_key_names + jupyter_token: "" + properties: + data: + $ref: '#/components/schemas/TerminateInstanceV1_response_data' + type: object + RetrieveCouponInformationV1_coupon: + example: + deactivationDate: 2024-08-07T16:41:43.000Z + code: TestCoupon + discountPercent: "0.1" + properties: + code: + example: TestCoupon + type: string + discountPercent: + example: "0.1" + type: string + deactivationDate: + example: 2024-08-07T16:41:43.000Z + type: string + type: object + RetrieveAcceptProductsV1_couponValidation_productDetails_inner: + example: + - name: gpu_1x_a6000 + description: 1x RTX A6000 + pricePerHour: "0.625000" + inventoryAvailable: true + - name: gpu_2x_a6000 + description: 2x RTX A6000 + pricePerHour: "1.250000" + inventoryAvailable: true + - name: gpu_4x_a6000 + description: 4x RTX A6000 + pricePerHour: "2.500000" + inventoryAvailable: true + - name: gpu_8x_a6000 + description: 8x RTX A6000 + pricePerHour: "5.000000" + inventoryAvailable: false + properties: + name: + example: gpu_1x_a6000 + type: string + description: + example: 1x RTX A6000 + type: string + pricePerHour: + example: "0.625000" + type: string + inventoryAvailable: + example: true + type: boolean + type: object + RetrieveAcceptProductsV1_couponValidation: + example: + coupon: + deactivationDate: 2024-08-07T16:41:43.000Z + code: TestCoupon + discountPercent: "0.1" + productDetails: + - - name: gpu_1x_a6000 + description: 1x RTX A6000 + pricePerHour: "0.625000" + inventoryAvailable: true + - name: gpu_2x_a6000 + description: 2x RTX A6000 + pricePerHour: "1.250000" + inventoryAvailable: true + - name: gpu_4x_a6000 + description: 4x RTX A6000 + pricePerHour: "2.500000" + inventoryAvailable: true + - name: gpu_8x_a6000 + description: 8x RTX A6000 + pricePerHour: "5.000000" + inventoryAvailable: false + - - name: gpu_1x_a6000 + description: 1x RTX A6000 + pricePerHour: "0.625000" + inventoryAvailable: true + - name: gpu_2x_a6000 + description: 2x RTX A6000 + pricePerHour: "1.250000" + inventoryAvailable: true + - name: gpu_4x_a6000 + description: 4x RTX A6000 + pricePerHour: "2.500000" + inventoryAvailable: true + - name: gpu_8x_a6000 + description: 8x RTX A6000 + pricePerHour: "5.000000" + inventoryAvailable: false + properties: + coupon: + $ref: '#/components/schemas/RetrieveCouponInformationV1_coupon' + productDetails: + items: + $ref: '#/components/schemas/RetrieveAcceptProductsV1_couponValidation_productDetails_inner' + type: array + type: object + POSTSSHKey_sshKey: + example: + name: name + id: id + properties: + id: + description: The unique identifier for the SSH key + type: string + name: + description: The name of the SSH key + type: string + type: object diff --git a/v1/providers/massedcompute/gen/massedcompute/api_account.go b/v1/providers/massedcompute/gen/massedcompute/api_account.go new file mode 100644 index 0000000..f323dfe --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/api_account.go @@ -0,0 +1,222 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + +// AccountAPIService AccountAPI service +type AccountAPIService service + +type ApiAccountBillingGetRequest struct { + ctx context.Context + ApiService *AccountAPIService +} + +func (r ApiAccountBillingGetRequest) Execute() (*RetrieveBillingInformationV1, *http.Response, error) { + return r.ApiService.AccountBillingGetExecute(r) +} + +/* +AccountBillingGet Retrieve billing information. + +Billing information for the account. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAccountBillingGetRequest +*/ +func (a *AccountAPIService) AccountBillingGet(ctx context.Context) ApiAccountBillingGetRequest { + return ApiAccountBillingGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return RetrieveBillingInformationV1 +func (a *AccountAPIService) AccountBillingGetExecute(r ApiAccountBillingGetRequest) (*RetrieveBillingInformationV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RetrieveBillingInformationV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccountAPIService.AccountBillingGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/account/billing" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAccountTokenValidationPostRequest struct { + ctx context.Context + ApiService *AccountAPIService +} + +func (r ApiAccountTokenValidationPostRequest) Execute() (*AccountTokenValidationPost200Response, *http.Response, error) { + return r.ApiService.AccountTokenValidationPostExecute(r) +} + +/* +AccountTokenValidationPost Validate an API token. + +An API token is required to access the API. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAccountTokenValidationPostRequest +*/ +func (a *AccountAPIService) AccountTokenValidationPost(ctx context.Context) ApiAccountTokenValidationPostRequest { + return ApiAccountTokenValidationPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return AccountTokenValidationPost200Response +func (a *AccountAPIService) AccountTokenValidationPostExecute(r ApiAccountTokenValidationPostRequest) (*AccountTokenValidationPost200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AccountTokenValidationPost200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccountAPIService.AccountTokenValidationPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/account/token/validation" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/v1/providers/massedcompute/gen/massedcompute/api_coupon.go b/v1/providers/massedcompute/gen/massedcompute/api_coupon.go new file mode 100644 index 0000000..d934da3 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/api_coupon.go @@ -0,0 +1,244 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + +// CouponAPIService CouponAPI service +type CouponAPIService service + +type ApiCouponAcceptedProductsPostRequest struct { + ctx context.Context + ApiService *CouponAPIService + couponInformationPostRequest *CouponInformationPostRequest +} + +func (r ApiCouponAcceptedProductsPostRequest) CouponInformationPostRequest(couponInformationPostRequest CouponInformationPostRequest) ApiCouponAcceptedProductsPostRequest { + r.couponInformationPostRequest = &couponInformationPostRequest + return r +} + +func (r ApiCouponAcceptedProductsPostRequest) Execute() (*RetrieveAcceptProductsV1, *http.Response, error) { + return r.ApiService.CouponAcceptedProductsPostExecute(r) +} + +/* +CouponAcceptedProductsPost Retrieve products that a coupon is valid for. + +A coupon is a discount code that can be applied to an instance when deployed. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCouponAcceptedProductsPostRequest +*/ +func (a *CouponAPIService) CouponAcceptedProductsPost(ctx context.Context) ApiCouponAcceptedProductsPostRequest { + return ApiCouponAcceptedProductsPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return RetrieveAcceptProductsV1 +func (a *CouponAPIService) CouponAcceptedProductsPostExecute(r ApiCouponAcceptedProductsPostRequest) (*RetrieveAcceptProductsV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RetrieveAcceptProductsV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CouponAPIService.CouponAcceptedProductsPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/coupon/accepted-products" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.couponInformationPostRequest == nil { + return localVarReturnValue, nil, reportError("couponInformationPostRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.couponInformationPostRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCouponInformationPostRequest struct { + ctx context.Context + ApiService *CouponAPIService + couponInformationPostRequest *CouponInformationPostRequest +} + +func (r ApiCouponInformationPostRequest) CouponInformationPostRequest(couponInformationPostRequest CouponInformationPostRequest) ApiCouponInformationPostRequest { + r.couponInformationPostRequest = &couponInformationPostRequest + return r +} + +func (r ApiCouponInformationPostRequest) Execute() (*RetrieveCouponInformationV1, *http.Response, error) { + return r.ApiService.CouponInformationPostExecute(r) +} + +/* +CouponInformationPost Retrieve information about a coupon. + +A coupon is a discount code that can be applied to an instance when deployed. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCouponInformationPostRequest +*/ +func (a *CouponAPIService) CouponInformationPost(ctx context.Context) ApiCouponInformationPostRequest { + return ApiCouponInformationPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return RetrieveCouponInformationV1 +func (a *CouponAPIService) CouponInformationPostExecute(r ApiCouponInformationPostRequest) (*RetrieveCouponInformationV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RetrieveCouponInformationV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CouponAPIService.CouponInformationPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/coupon/information" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.couponInformationPostRequest == nil { + return localVarReturnValue, nil, reportError("couponInformationPostRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.couponInformationPostRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/v1/providers/massedcompute/gen/massedcompute/api_default.go b/v1/providers/massedcompute/gen/massedcompute/api_default.go new file mode 100644 index 0000000..3a88f55 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/api_default.go @@ -0,0 +1,222 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiGpuInventoryGetRequest struct { + ctx context.Context + ApiService *DefaultAPIService +} + +func (r ApiGpuInventoryGetRequest) Execute() (*GPUInventoryV1, *http.Response, error) { + return r.ApiService.GpuInventoryGetExecute(r) +} + +/* +GpuInventoryGet Retrieve a list of avaialable GPU configurations. + +An comprehensive list of all GPU types, configurations, and available inventory. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGpuInventoryGetRequest +*/ +func (a *DefaultAPIService) GpuInventoryGet(ctx context.Context) ApiGpuInventoryGetRequest { + return ApiGpuInventoryGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return GPUInventoryV1 +func (a *DefaultAPIService) GpuInventoryGetExecute(r ApiGpuInventoryGetRequest) (*GPUInventoryV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GPUInventoryV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GpuInventoryGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/gpu-inventory" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiImagesGetRequest struct { + ctx context.Context + ApiService *DefaultAPIService +} + +func (r ApiImagesGetRequest) Execute() (*ImagesV1, *http.Response, error) { + return r.ApiService.ImagesGetExecute(r) +} + +/* +ImagesGet Retrieve list of available images. + +An Image is a preconfigured operating system and software stack. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiImagesGetRequest +*/ +func (a *DefaultAPIService) ImagesGet(ctx context.Context) ApiImagesGetRequest { + return ApiImagesGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ImagesV1 +func (a *DefaultAPIService) ImagesGetExecute(r ApiImagesGetRequest) (*ImagesV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImagesV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ImagesGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/v1/providers/massedcompute/gen/massedcompute/api_instances.go b/v1/providers/massedcompute/gen/massedcompute/api_instances.go new file mode 100644 index 0000000..21b7d82 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/api_instances.go @@ -0,0 +1,556 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// InstancesAPIService InstancesAPI service +type InstancesAPIService service + +type ApiInstanceGetRequest struct { + ctx context.Context + ApiService *InstancesAPIService +} + +func (r ApiInstanceGetRequest) Execute() (*RetrieveAllRunningInstancesV1, *http.Response, error) { + return r.ApiService.InstanceGetExecute(r) +} + +/* +InstanceGet Retrieve list of all running instances. + +An instance is a virtual machine that is currently running. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInstanceGetRequest +*/ +func (a *InstancesAPIService) InstanceGet(ctx context.Context) ApiInstanceGetRequest { + return ApiInstanceGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return RetrieveAllRunningInstancesV1 +func (a *InstancesAPIService) InstanceGetExecute(r ApiInstanceGetRequest) (*RetrieveAllRunningInstancesV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RetrieveAllRunningInstancesV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InstancesAPIService.InstanceGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/instance" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInstanceLaunchPostRequest struct { + ctx context.Context + ApiService *InstancesAPIService + instanceLaunchPostRequest *InstanceLaunchPostRequest +} + +func (r ApiInstanceLaunchPostRequest) InstanceLaunchPostRequest(instanceLaunchPostRequest InstanceLaunchPostRequest) ApiInstanceLaunchPostRequest { + r.instanceLaunchPostRequest = &instanceLaunchPostRequest + return r +} + +func (r ApiInstanceLaunchPostRequest) Execute() (*InstanceLaunchPost202Response, *http.Response, error) { + return r.ApiService.InstanceLaunchPostExecute(r) +} + +/* +InstanceLaunchPost Deploy new instances. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInstanceLaunchPostRequest +*/ +func (a *InstancesAPIService) InstanceLaunchPost(ctx context.Context) ApiInstanceLaunchPostRequest { + return ApiInstanceLaunchPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return InstanceLaunchPost202Response +func (a *InstancesAPIService) InstanceLaunchPostExecute(r ApiInstanceLaunchPostRequest) (*InstanceLaunchPost202Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InstanceLaunchPost202Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InstancesAPIService.InstanceLaunchPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/instance/launch" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.instanceLaunchPostRequest == nil { + return localVarReturnValue, nil, reportError("instanceLaunchPostRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.instanceLaunchPostRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInstanceRestartPostRequest struct { + ctx context.Context + ApiService *InstancesAPIService + instanceRestartPostRequest *InstanceRestartPostRequest +} + +func (r ApiInstanceRestartPostRequest) InstanceRestartPostRequest(instanceRestartPostRequest InstanceRestartPostRequest) ApiInstanceRestartPostRequest { + r.instanceRestartPostRequest = &instanceRestartPostRequest + return r +} + +func (r ApiInstanceRestartPostRequest) Execute() (*RestartInstanceV1, *http.Response, error) { + return r.ApiService.InstanceRestartPostExecute(r) +} + +/* +InstanceRestartPost Restart an instances. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInstanceRestartPostRequest +*/ +func (a *InstancesAPIService) InstanceRestartPost(ctx context.Context) ApiInstanceRestartPostRequest { + return ApiInstanceRestartPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return RestartInstanceV1 +func (a *InstancesAPIService) InstanceRestartPostExecute(r ApiInstanceRestartPostRequest) (*RestartInstanceV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RestartInstanceV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InstancesAPIService.InstanceRestartPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/instance/restart" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.instanceRestartPostRequest == nil { + return localVarReturnValue, nil, reportError("instanceRestartPostRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.instanceRestartPostRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInstanceTerminatePostRequest struct { + ctx context.Context + ApiService *InstancesAPIService + instanceRestartPostRequest *InstanceRestartPostRequest +} + +func (r ApiInstanceTerminatePostRequest) InstanceRestartPostRequest(instanceRestartPostRequest InstanceRestartPostRequest) ApiInstanceTerminatePostRequest { + r.instanceRestartPostRequest = &instanceRestartPostRequest + return r +} + +func (r ApiInstanceTerminatePostRequest) Execute() (*TerminateInstanceV1, *http.Response, error) { + return r.ApiService.InstanceTerminatePostExecute(r) +} + +/* +InstanceTerminatePost Terminate an instances. + +Termination completely removes the instance from the system and destroys all data. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInstanceTerminatePostRequest +*/ +func (a *InstancesAPIService) InstanceTerminatePost(ctx context.Context) ApiInstanceTerminatePostRequest { + return ApiInstanceTerminatePostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return TerminateInstanceV1 +func (a *InstancesAPIService) InstanceTerminatePostExecute(r ApiInstanceTerminatePostRequest) (*TerminateInstanceV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TerminateInstanceV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InstancesAPIService.InstanceTerminatePost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/instance/terminate" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.instanceRestartPostRequest == nil { + return localVarReturnValue, nil, reportError("instanceRestartPostRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.instanceRestartPostRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInstanceUuidGetRequest struct { + ctx context.Context + ApiService *InstancesAPIService + uuid string +} + +func (r ApiInstanceUuidGetRequest) Execute() (*RetrieveAllRunningInstancesV1, *http.Response, error) { + return r.ApiService.InstanceUuidGetExecute(r) +} + +/* +InstanceUuidGet Retrieve single running instances. + +An instance is a virtual machine that is currently running. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid + @return ApiInstanceUuidGetRequest +*/ +func (a *InstancesAPIService) InstanceUuidGet(ctx context.Context, uuid string) ApiInstanceUuidGetRequest { + return ApiInstanceUuidGetRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return RetrieveAllRunningInstancesV1 +func (a *InstancesAPIService) InstanceUuidGetExecute(r ApiInstanceUuidGetRequest) (*RetrieveAllRunningInstancesV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RetrieveAllRunningInstancesV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InstancesAPIService.InstanceUuidGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/instance/{uuid}" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/v1/providers/massedcompute/gen/massedcompute/api_ssh_keys.go b/v1/providers/massedcompute/gen/massedcompute/api_ssh_keys.go new file mode 100644 index 0000000..0f73a91 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/api_ssh_keys.go @@ -0,0 +1,338 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// SSHKeysAPIService SSHKeysAPI service +type SSHKeysAPIService service + +type ApiSshKeysGetRequest struct { + ctx context.Context + ApiService *SSHKeysAPIService +} + +func (r ApiSshKeysGetRequest) Execute() (*SSHKey, *http.Response, error) { + return r.ApiService.SshKeysGetExecute(r) +} + +/* +SshKeysGet Retrieve SSH keys associated with the account. + +An SSH key is a secure access credential used to connect to instances. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSshKeysGetRequest +*/ +func (a *SSHKeysAPIService) SshKeysGet(ctx context.Context) ApiSshKeysGetRequest { + return ApiSshKeysGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SSHKey +func (a *SSHKeysAPIService) SshKeysGetExecute(r ApiSshKeysGetRequest) (*SSHKey, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SSHKey + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SSHKeysAPIService.SshKeysGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ssh-keys" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSshKeysIdDeleteRequest struct { + ctx context.Context + ApiService *SSHKeysAPIService + id string +} + +func (r ApiSshKeysIdDeleteRequest) Execute() (*SshKeysIdDelete200Response, *http.Response, error) { + return r.ApiService.SshKeysIdDeleteExecute(r) +} + +/* +SshKeysIdDelete Remove an SSH key from the account. + +An SSH key is a secure access credential used to connect to instances. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id The unique identifier for the SSH key to be removed + @return ApiSshKeysIdDeleteRequest +*/ +func (a *SSHKeysAPIService) SshKeysIdDelete(ctx context.Context, id string) ApiSshKeysIdDeleteRequest { + return ApiSshKeysIdDeleteRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SshKeysIdDelete200Response +func (a *SSHKeysAPIService) SshKeysIdDeleteExecute(r ApiSshKeysIdDeleteRequest) (*SshKeysIdDelete200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SshKeysIdDelete200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SSHKeysAPIService.SshKeysIdDelete") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ssh-keys/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSshKeysPostRequest struct { + ctx context.Context + ApiService *SSHKeysAPIService + sshKeysPostRequest *SshKeysPostRequest +} + +func (r ApiSshKeysPostRequest) SshKeysPostRequest(sshKeysPostRequest SshKeysPostRequest) ApiSshKeysPostRequest { + r.sshKeysPostRequest = &sshKeysPostRequest + return r +} + +func (r ApiSshKeysPostRequest) Execute() (*POSTSSHKey, *http.Response, error) { + return r.ApiService.SshKeysPostExecute(r) +} + +/* +SshKeysPost Add an SSH key to the account. + +An SSH key is a secure access credential used to connect to instances. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSshKeysPostRequest +*/ +func (a *SSHKeysAPIService) SshKeysPost(ctx context.Context) ApiSshKeysPostRequest { + return ApiSshKeysPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return POSTSSHKey +func (a *SSHKeysAPIService) SshKeysPostExecute(r ApiSshKeysPostRequest) (*POSTSSHKey, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *POSTSSHKey + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SSHKeysAPIService.SshKeysPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ssh-keys" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sshKeysPostRequest == nil { + return localVarReturnValue, nil, reportError("sshKeysPostRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sshKeysPostRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/v1/providers/massedcompute/gen/massedcompute/client.go b/v1/providers/massedcompute/gen/massedcompute/client.go new file mode 100644 index 0000000..96b8c7e --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/client.go @@ -0,0 +1,663 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the Massed Compute VM API API v1.0.0 +// 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 + + AccountAPI *AccountAPIService + + CouponAPI *CouponAPIService + + DefaultAPI *DefaultAPIService + + InstancesAPI *InstancesAPIService + + SSHKeysAPI *SSHKeysAPIService +} + +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.AccountAPI = (*AccountAPIService)(&c.common) + c.CouponAPI = (*CouponAPIService)(&c.common) + c.DefaultAPI = (*DefaultAPIService)(&c.common) + c.InstancesAPI = (*InstancesAPIService)(&c.common) + c.SSHKeysAPI = (*SSHKeysAPIService)(&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{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, 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(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, 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. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/configuration.go b/v1/providers/massedcompute/gen/massedcompute/configuration.go new file mode 100644 index 0000000..2d0f913 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/configuration.go @@ -0,0 +1,214 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "https://vm.massedcompute.com/api/v1", + 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) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/AccountAPI.md b/v1/providers/massedcompute/gen/massedcompute/docs/AccountAPI.md new file mode 100644 index 0000000..5d0b8e1 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/AccountAPI.md @@ -0,0 +1,132 @@ +# \AccountAPI + +All URIs are relative to *https://vm.massedcompute.com/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AccountBillingGet**](AccountAPI.md#AccountBillingGet) | **Get** /account/billing | Retrieve billing information. +[**AccountTokenValidationPost**](AccountAPI.md#AccountTokenValidationPost) | **Post** /account/token/validation | Validate an API token. + + + +## AccountBillingGet + +> RetrieveBillingInformationV1 AccountBillingGet(ctx).Execute() + +Retrieve billing information. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/brevdev/cloud" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AccountAPI.AccountBillingGet(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AccountAPI.AccountBillingGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AccountBillingGet`: RetrieveBillingInformationV1 + fmt.Fprintf(os.Stdout, "Response from `AccountAPI.AccountBillingGet`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiAccountBillingGetRequest struct via the builder pattern + + +### Return type + +[**RetrieveBillingInformationV1**](RetrieveBillingInformationV1.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) + + +## AccountTokenValidationPost + +> AccountTokenValidationPost200Response AccountTokenValidationPost(ctx).Execute() + +Validate an API token. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/brevdev/cloud" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AccountAPI.AccountTokenValidationPost(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AccountAPI.AccountTokenValidationPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AccountTokenValidationPost`: AccountTokenValidationPost200Response + fmt.Fprintf(os.Stdout, "Response from `AccountAPI.AccountTokenValidationPost`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiAccountTokenValidationPostRequest struct via the builder pattern + + +### Return type + +[**AccountTokenValidationPost200Response**](AccountTokenValidationPost200Response.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) + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/AccountTokenValidationPost200Response.md b/v1/providers/massedcompute/gen/massedcompute/docs/AccountTokenValidationPost200Response.md new file mode 100644 index 0000000..aa2ee72 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/AccountTokenValidationPost200Response.md @@ -0,0 +1,56 @@ +# AccountTokenValidationPost200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | Pointer to **string** | | [optional] + +## Methods + +### NewAccountTokenValidationPost200Response + +`func NewAccountTokenValidationPost200Response() *AccountTokenValidationPost200Response` + +NewAccountTokenValidationPost200Response instantiates a new AccountTokenValidationPost200Response 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 + +### NewAccountTokenValidationPost200ResponseWithDefaults + +`func NewAccountTokenValidationPost200ResponseWithDefaults() *AccountTokenValidationPost200Response` + +NewAccountTokenValidationPost200ResponseWithDefaults instantiates a new AccountTokenValidationPost200Response 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 + +### GetMessage + +`func (o *AccountTokenValidationPost200Response) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *AccountTokenValidationPost200Response) 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 *AccountTokenValidationPost200Response) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *AccountTokenValidationPost200Response) HasMessage() bool` + +HasMessage 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/CouponAPI.md b/v1/providers/massedcompute/gen/massedcompute/docs/CouponAPI.md new file mode 100644 index 0000000..9a185d4 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/CouponAPI.md @@ -0,0 +1,142 @@ +# \CouponAPI + +All URIs are relative to *https://vm.massedcompute.com/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CouponAcceptedProductsPost**](CouponAPI.md#CouponAcceptedProductsPost) | **Post** /coupon/accepted-products | Retrieve products that a coupon is valid for. +[**CouponInformationPost**](CouponAPI.md#CouponInformationPost) | **Post** /coupon/information | Retrieve information about a coupon. + + + +## CouponAcceptedProductsPost + +> RetrieveAcceptProductsV1 CouponAcceptedProductsPost(ctx).CouponInformationPostRequest(couponInformationPostRequest).Execute() + +Retrieve products that a coupon is valid for. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/brevdev/cloud" +) + +func main() { + couponInformationPostRequest := *openapiclient.NewCouponInformationPostRequest() // CouponInformationPostRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CouponAPI.CouponAcceptedProductsPost(context.Background()).CouponInformationPostRequest(couponInformationPostRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CouponAPI.CouponAcceptedProductsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CouponAcceptedProductsPost`: RetrieveAcceptProductsV1 + fmt.Fprintf(os.Stdout, "Response from `CouponAPI.CouponAcceptedProductsPost`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCouponAcceptedProductsPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **couponInformationPostRequest** | [**CouponInformationPostRequest**](CouponInformationPostRequest.md) | | + +### Return type + +[**RetrieveAcceptProductsV1**](RetrieveAcceptProductsV1.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CouponInformationPost + +> RetrieveCouponInformationV1 CouponInformationPost(ctx).CouponInformationPostRequest(couponInformationPostRequest).Execute() + +Retrieve information about a coupon. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/brevdev/cloud" +) + +func main() { + couponInformationPostRequest := *openapiclient.NewCouponInformationPostRequest() // CouponInformationPostRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CouponAPI.CouponInformationPost(context.Background()).CouponInformationPostRequest(couponInformationPostRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CouponAPI.CouponInformationPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CouponInformationPost`: RetrieveCouponInformationV1 + fmt.Fprintf(os.Stdout, "Response from `CouponAPI.CouponInformationPost`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCouponInformationPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **couponInformationPostRequest** | [**CouponInformationPostRequest**](CouponInformationPostRequest.md) | | + +### Return type + +[**RetrieveCouponInformationV1**](RetrieveCouponInformationV1.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/CouponInformationPostRequest.md b/v1/providers/massedcompute/gen/massedcompute/docs/CouponInformationPostRequest.md new file mode 100644 index 0000000..1497878 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/CouponInformationPostRequest.md @@ -0,0 +1,56 @@ +# CouponInformationPostRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Coupon** | Pointer to **string** | The coupon code you want to retrieve information about | [optional] + +## Methods + +### NewCouponInformationPostRequest + +`func NewCouponInformationPostRequest() *CouponInformationPostRequest` + +NewCouponInformationPostRequest instantiates a new CouponInformationPostRequest 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 + +### NewCouponInformationPostRequestWithDefaults + +`func NewCouponInformationPostRequestWithDefaults() *CouponInformationPostRequest` + +NewCouponInformationPostRequestWithDefaults instantiates a new CouponInformationPostRequest 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 + +### GetCoupon + +`func (o *CouponInformationPostRequest) GetCoupon() string` + +GetCoupon returns the Coupon field if non-nil, zero value otherwise. + +### GetCouponOk + +`func (o *CouponInformationPostRequest) GetCouponOk() (*string, bool)` + +GetCouponOk returns a tuple with the Coupon field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCoupon + +`func (o *CouponInformationPostRequest) SetCoupon(v string)` + +SetCoupon sets Coupon field to given value. + +### HasCoupon + +`func (o *CouponInformationPostRequest) HasCoupon() bool` + +HasCoupon 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/DefaultAPI.md b/v1/providers/massedcompute/gen/massedcompute/docs/DefaultAPI.md new file mode 100644 index 0000000..2b07ce0 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/DefaultAPI.md @@ -0,0 +1,132 @@ +# \DefaultAPI + +All URIs are relative to *https://vm.massedcompute.com/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GpuInventoryGet**](DefaultAPI.md#GpuInventoryGet) | **Get** /gpu-inventory | Retrieve a list of avaialable GPU configurations. +[**ImagesGet**](DefaultAPI.md#ImagesGet) | **Get** /images | Retrieve list of available images. + + + +## GpuInventoryGet + +> GPUInventoryV1 GpuInventoryGet(ctx).Execute() + +Retrieve a list of avaialable GPU configurations. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/brevdev/cloud" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultAPI.GpuInventoryGet(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GpuInventoryGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GpuInventoryGet`: GPUInventoryV1 + fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GpuInventoryGet`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGpuInventoryGetRequest struct via the builder pattern + + +### Return type + +[**GPUInventoryV1**](GPUInventoryV1.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) + + +## ImagesGet + +> ImagesV1 ImagesGet(ctx).Execute() + +Retrieve list of available images. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/brevdev/cloud" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultAPI.ImagesGet(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.ImagesGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ImagesGet`: ImagesV1 + fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.ImagesGet`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiImagesGetRequest struct via the builder pattern + + +### Return type + +[**ImagesV1**](ImagesV1.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) + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/GPUInventoryV1.md b/v1/providers/massedcompute/gen/massedcompute/docs/GPUInventoryV1.md new file mode 100644 index 0000000..ce995b5 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/GPUInventoryV1.md @@ -0,0 +1,56 @@ +# GPUInventoryV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**GpuInventory** | Pointer to [**map[string]GPUInventoryV1GpuInventoryValue**](GPUInventoryV1GpuInventoryValue.md) | | [optional] + +## Methods + +### NewGPUInventoryV1 + +`func NewGPUInventoryV1() *GPUInventoryV1` + +NewGPUInventoryV1 instantiates a new GPUInventoryV1 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 + +### NewGPUInventoryV1WithDefaults + +`func NewGPUInventoryV1WithDefaults() *GPUInventoryV1` + +NewGPUInventoryV1WithDefaults instantiates a new GPUInventoryV1 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 + +### GetGpuInventory + +`func (o *GPUInventoryV1) GetGpuInventory() map[string]GPUInventoryV1GpuInventoryValue` + +GetGpuInventory returns the GpuInventory field if non-nil, zero value otherwise. + +### GetGpuInventoryOk + +`func (o *GPUInventoryV1) GetGpuInventoryOk() (*map[string]GPUInventoryV1GpuInventoryValue, bool)` + +GetGpuInventoryOk returns a tuple with the GpuInventory field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGpuInventory + +`func (o *GPUInventoryV1) SetGpuInventory(v map[string]GPUInventoryV1GpuInventoryValue)` + +SetGpuInventory sets GpuInventory field to given value. + +### HasGpuInventory + +`func (o *GPUInventoryV1) HasGpuInventory() bool` + +HasGpuInventory 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/GPUInventoryV1GpuInventoryValue.md b/v1/providers/massedcompute/gen/massedcompute/docs/GPUInventoryV1GpuInventoryValue.md new file mode 100644 index 0000000..f6780b7 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/GPUInventoryV1GpuInventoryValue.md @@ -0,0 +1,108 @@ +# GPUInventoryV1GpuInventoryValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**InstanceType** | Pointer to [**GPUInventoryV1GpuInventoryValueInstanceType**](GPUInventoryV1GpuInventoryValueInstanceType.md) | | [optional] +**RegionsWithCapacityAvailable** | Pointer to [**[]GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner**](GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner.md) | | [optional] +**CapacityAvailable** | Pointer to **int32** | | [optional] + +## Methods + +### NewGPUInventoryV1GpuInventoryValue + +`func NewGPUInventoryV1GpuInventoryValue() *GPUInventoryV1GpuInventoryValue` + +NewGPUInventoryV1GpuInventoryValue instantiates a new GPUInventoryV1GpuInventoryValue 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 + +### NewGPUInventoryV1GpuInventoryValueWithDefaults + +`func NewGPUInventoryV1GpuInventoryValueWithDefaults() *GPUInventoryV1GpuInventoryValue` + +NewGPUInventoryV1GpuInventoryValueWithDefaults instantiates a new GPUInventoryV1GpuInventoryValue 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 + +### GetInstanceType + +`func (o *GPUInventoryV1GpuInventoryValue) GetInstanceType() GPUInventoryV1GpuInventoryValueInstanceType` + +GetInstanceType returns the InstanceType field if non-nil, zero value otherwise. + +### GetInstanceTypeOk + +`func (o *GPUInventoryV1GpuInventoryValue) GetInstanceTypeOk() (*GPUInventoryV1GpuInventoryValueInstanceType, bool)` + +GetInstanceTypeOk returns a tuple with the InstanceType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstanceType + +`func (o *GPUInventoryV1GpuInventoryValue) SetInstanceType(v GPUInventoryV1GpuInventoryValueInstanceType)` + +SetInstanceType sets InstanceType field to given value. + +### HasInstanceType + +`func (o *GPUInventoryV1GpuInventoryValue) HasInstanceType() bool` + +HasInstanceType returns a boolean if a field has been set. + +### GetRegionsWithCapacityAvailable + +`func (o *GPUInventoryV1GpuInventoryValue) GetRegionsWithCapacityAvailable() []GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner` + +GetRegionsWithCapacityAvailable returns the RegionsWithCapacityAvailable field if non-nil, zero value otherwise. + +### GetRegionsWithCapacityAvailableOk + +`func (o *GPUInventoryV1GpuInventoryValue) GetRegionsWithCapacityAvailableOk() (*[]GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner, bool)` + +GetRegionsWithCapacityAvailableOk returns a tuple with the RegionsWithCapacityAvailable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRegionsWithCapacityAvailable + +`func (o *GPUInventoryV1GpuInventoryValue) SetRegionsWithCapacityAvailable(v []GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner)` + +SetRegionsWithCapacityAvailable sets RegionsWithCapacityAvailable field to given value. + +### HasRegionsWithCapacityAvailable + +`func (o *GPUInventoryV1GpuInventoryValue) HasRegionsWithCapacityAvailable() bool` + +HasRegionsWithCapacityAvailable returns a boolean if a field has been set. + +### GetCapacityAvailable + +`func (o *GPUInventoryV1GpuInventoryValue) GetCapacityAvailable() int32` + +GetCapacityAvailable returns the CapacityAvailable field if non-nil, zero value otherwise. + +### GetCapacityAvailableOk + +`func (o *GPUInventoryV1GpuInventoryValue) GetCapacityAvailableOk() (*int32, bool)` + +GetCapacityAvailableOk returns a tuple with the CapacityAvailable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCapacityAvailable + +`func (o *GPUInventoryV1GpuInventoryValue) SetCapacityAvailable(v int32)` + +SetCapacityAvailable sets CapacityAvailable field to given value. + +### HasCapacityAvailable + +`func (o *GPUInventoryV1GpuInventoryValue) HasCapacityAvailable() bool` + +HasCapacityAvailable 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/GPUInventoryV1GpuInventoryValueInstanceType.md b/v1/providers/massedcompute/gen/massedcompute/docs/GPUInventoryV1GpuInventoryValueInstanceType.md new file mode 100644 index 0000000..8df37c5 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/GPUInventoryV1GpuInventoryValueInstanceType.md @@ -0,0 +1,134 @@ +# GPUInventoryV1GpuInventoryValueInstanceType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | | [optional] +**Description** | Pointer to **string** | | [optional] +**PriceCentsPerHour** | Pointer to **int32** | | [optional] +**Specs** | Pointer to [**GPUInventoryV1GpuInventoryValueInstanceTypeSpecs**](GPUInventoryV1GpuInventoryValueInstanceTypeSpecs.md) | | [optional] + +## Methods + +### NewGPUInventoryV1GpuInventoryValueInstanceType + +`func NewGPUInventoryV1GpuInventoryValueInstanceType() *GPUInventoryV1GpuInventoryValueInstanceType` + +NewGPUInventoryV1GpuInventoryValueInstanceType instantiates a new GPUInventoryV1GpuInventoryValueInstanceType 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 + +### NewGPUInventoryV1GpuInventoryValueInstanceTypeWithDefaults + +`func NewGPUInventoryV1GpuInventoryValueInstanceTypeWithDefaults() *GPUInventoryV1GpuInventoryValueInstanceType` + +NewGPUInventoryV1GpuInventoryValueInstanceTypeWithDefaults instantiates a new GPUInventoryV1GpuInventoryValueInstanceType object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *GPUInventoryV1GpuInventoryValueInstanceType) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *GPUInventoryV1GpuInventoryValueInstanceType) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *GPUInventoryV1GpuInventoryValueInstanceType) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *GPUInventoryV1GpuInventoryValueInstanceType) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetDescription + +`func (o *GPUInventoryV1GpuInventoryValueInstanceType) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *GPUInventoryV1GpuInventoryValueInstanceType) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *GPUInventoryV1GpuInventoryValueInstanceType) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *GPUInventoryV1GpuInventoryValueInstanceType) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetPriceCentsPerHour + +`func (o *GPUInventoryV1GpuInventoryValueInstanceType) GetPriceCentsPerHour() int32` + +GetPriceCentsPerHour returns the PriceCentsPerHour field if non-nil, zero value otherwise. + +### GetPriceCentsPerHourOk + +`func (o *GPUInventoryV1GpuInventoryValueInstanceType) GetPriceCentsPerHourOk() (*int32, bool)` + +GetPriceCentsPerHourOk returns a tuple with the PriceCentsPerHour field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPriceCentsPerHour + +`func (o *GPUInventoryV1GpuInventoryValueInstanceType) SetPriceCentsPerHour(v int32)` + +SetPriceCentsPerHour sets PriceCentsPerHour field to given value. + +### HasPriceCentsPerHour + +`func (o *GPUInventoryV1GpuInventoryValueInstanceType) HasPriceCentsPerHour() bool` + +HasPriceCentsPerHour returns a boolean if a field has been set. + +### GetSpecs + +`func (o *GPUInventoryV1GpuInventoryValueInstanceType) GetSpecs() GPUInventoryV1GpuInventoryValueInstanceTypeSpecs` + +GetSpecs returns the Specs field if non-nil, zero value otherwise. + +### GetSpecsOk + +`func (o *GPUInventoryV1GpuInventoryValueInstanceType) GetSpecsOk() (*GPUInventoryV1GpuInventoryValueInstanceTypeSpecs, bool)` + +GetSpecsOk returns a tuple with the Specs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpecs + +`func (o *GPUInventoryV1GpuInventoryValueInstanceType) SetSpecs(v GPUInventoryV1GpuInventoryValueInstanceTypeSpecs)` + +SetSpecs sets Specs field to given value. + +### HasSpecs + +`func (o *GPUInventoryV1GpuInventoryValueInstanceType) HasSpecs() bool` + +HasSpecs 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/GPUInventoryV1GpuInventoryValueInstanceTypeSpecs.md b/v1/providers/massedcompute/gen/massedcompute/docs/GPUInventoryV1GpuInventoryValueInstanceTypeSpecs.md new file mode 100644 index 0000000..c517f2e --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/GPUInventoryV1GpuInventoryValueInstanceTypeSpecs.md @@ -0,0 +1,108 @@ +# GPUInventoryV1GpuInventoryValueInstanceTypeSpecs + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VcpuCount** | Pointer to **int32** | | [optional] +**MemoryGib** | Pointer to **int32** | | [optional] +**StorageGb** | Pointer to **int32** | | [optional] + +## Methods + +### NewGPUInventoryV1GpuInventoryValueInstanceTypeSpecs + +`func NewGPUInventoryV1GpuInventoryValueInstanceTypeSpecs() *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs` + +NewGPUInventoryV1GpuInventoryValueInstanceTypeSpecs instantiates a new GPUInventoryV1GpuInventoryValueInstanceTypeSpecs 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 + +### NewGPUInventoryV1GpuInventoryValueInstanceTypeSpecsWithDefaults + +`func NewGPUInventoryV1GpuInventoryValueInstanceTypeSpecsWithDefaults() *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs` + +NewGPUInventoryV1GpuInventoryValueInstanceTypeSpecsWithDefaults instantiates a new GPUInventoryV1GpuInventoryValueInstanceTypeSpecs 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 + +### GetVcpuCount + +`func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) GetVcpuCount() int32` + +GetVcpuCount returns the VcpuCount field if non-nil, zero value otherwise. + +### GetVcpuCountOk + +`func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) GetVcpuCountOk() (*int32, bool)` + +GetVcpuCountOk returns a tuple with the VcpuCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVcpuCount + +`func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) SetVcpuCount(v int32)` + +SetVcpuCount sets VcpuCount field to given value. + +### HasVcpuCount + +`func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) HasVcpuCount() bool` + +HasVcpuCount returns a boolean if a field has been set. + +### GetMemoryGib + +`func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) GetMemoryGib() int32` + +GetMemoryGib returns the MemoryGib field if non-nil, zero value otherwise. + +### GetMemoryGibOk + +`func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) GetMemoryGibOk() (*int32, bool)` + +GetMemoryGibOk returns a tuple with the MemoryGib field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemoryGib + +`func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) SetMemoryGib(v int32)` + +SetMemoryGib sets MemoryGib field to given value. + +### HasMemoryGib + +`func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) HasMemoryGib() bool` + +HasMemoryGib returns a boolean if a field has been set. + +### GetStorageGb + +`func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) GetStorageGb() int32` + +GetStorageGb returns the StorageGb field if non-nil, zero value otherwise. + +### GetStorageGbOk + +`func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) GetStorageGbOk() (*int32, bool)` + +GetStorageGbOk returns a tuple with the StorageGb field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStorageGb + +`func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) SetStorageGb(v int32)` + +SetStorageGb sets StorageGb field to given value. + +### HasStorageGb + +`func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) HasStorageGb() bool` + +HasStorageGb 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner.md b/v1/providers/massedcompute/gen/massedcompute/docs/GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner.md new file mode 100644 index 0000000..41bdb46 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner.md @@ -0,0 +1,82 @@ +# GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | | [optional] +**Description** | Pointer to **string** | | [optional] + +## Methods + +### NewGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner + +`func NewGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner() *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner` + +NewGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner instantiates a new GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner 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 + +### NewGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInnerWithDefaults + +`func NewGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInnerWithDefaults() *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner` + +NewGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInnerWithDefaults instantiates a new GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetDescription + +`func (o *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) HasDescription() bool` + +HasDescription 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/ImagesV1.md b/v1/providers/massedcompute/gen/massedcompute/docs/ImagesV1.md new file mode 100644 index 0000000..0efe0f1 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/ImagesV1.md @@ -0,0 +1,56 @@ +# ImagesV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Images** | Pointer to [**[]ImagesV1ImagesInner**](ImagesV1ImagesInner.md) | | [optional] + +## Methods + +### NewImagesV1 + +`func NewImagesV1() *ImagesV1` + +NewImagesV1 instantiates a new ImagesV1 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 + +### NewImagesV1WithDefaults + +`func NewImagesV1WithDefaults() *ImagesV1` + +NewImagesV1WithDefaults instantiates a new ImagesV1 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 + +### GetImages + +`func (o *ImagesV1) GetImages() []ImagesV1ImagesInner` + +GetImages returns the Images field if non-nil, zero value otherwise. + +### GetImagesOk + +`func (o *ImagesV1) GetImagesOk() (*[]ImagesV1ImagesInner, bool)` + +GetImagesOk returns a tuple with the Images field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetImages + +`func (o *ImagesV1) SetImages(v []ImagesV1ImagesInner)` + +SetImages sets Images field to given value. + +### HasImages + +`func (o *ImagesV1) HasImages() bool` + +HasImages 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/ImagesV1ImagesInner.md b/v1/providers/massedcompute/gen/massedcompute/docs/ImagesV1ImagesInner.md new file mode 100644 index 0000000..3067a7a --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/ImagesV1ImagesInner.md @@ -0,0 +1,108 @@ +# ImagesV1ImagesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VmImageId** | Pointer to **int32** | | [optional] +**VmImageName** | Pointer to **string** | | [optional] +**VmImageDescription** | Pointer to **string** | | [optional] + +## Methods + +### NewImagesV1ImagesInner + +`func NewImagesV1ImagesInner() *ImagesV1ImagesInner` + +NewImagesV1ImagesInner instantiates a new ImagesV1ImagesInner 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 + +### NewImagesV1ImagesInnerWithDefaults + +`func NewImagesV1ImagesInnerWithDefaults() *ImagesV1ImagesInner` + +NewImagesV1ImagesInnerWithDefaults instantiates a new ImagesV1ImagesInner 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 + +### GetVmImageId + +`func (o *ImagesV1ImagesInner) GetVmImageId() int32` + +GetVmImageId returns the VmImageId field if non-nil, zero value otherwise. + +### GetVmImageIdOk + +`func (o *ImagesV1ImagesInner) GetVmImageIdOk() (*int32, bool)` + +GetVmImageIdOk returns a tuple with the VmImageId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVmImageId + +`func (o *ImagesV1ImagesInner) SetVmImageId(v int32)` + +SetVmImageId sets VmImageId field to given value. + +### HasVmImageId + +`func (o *ImagesV1ImagesInner) HasVmImageId() bool` + +HasVmImageId returns a boolean if a field has been set. + +### GetVmImageName + +`func (o *ImagesV1ImagesInner) GetVmImageName() string` + +GetVmImageName returns the VmImageName field if non-nil, zero value otherwise. + +### GetVmImageNameOk + +`func (o *ImagesV1ImagesInner) GetVmImageNameOk() (*string, bool)` + +GetVmImageNameOk returns a tuple with the VmImageName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVmImageName + +`func (o *ImagesV1ImagesInner) SetVmImageName(v string)` + +SetVmImageName sets VmImageName field to given value. + +### HasVmImageName + +`func (o *ImagesV1ImagesInner) HasVmImageName() bool` + +HasVmImageName returns a boolean if a field has been set. + +### GetVmImageDescription + +`func (o *ImagesV1ImagesInner) GetVmImageDescription() string` + +GetVmImageDescription returns the VmImageDescription field if non-nil, zero value otherwise. + +### GetVmImageDescriptionOk + +`func (o *ImagesV1ImagesInner) GetVmImageDescriptionOk() (*string, bool)` + +GetVmImageDescriptionOk returns a tuple with the VmImageDescription field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVmImageDescription + +`func (o *ImagesV1ImagesInner) SetVmImageDescription(v string)` + +SetVmImageDescription sets VmImageDescription field to given value. + +### HasVmImageDescription + +`func (o *ImagesV1ImagesInner) HasVmImageDescription() bool` + +HasVmImageDescription 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/InstanceLaunchPost202Response.md b/v1/providers/massedcompute/gen/massedcompute/docs/InstanceLaunchPost202Response.md new file mode 100644 index 0000000..3e21d84 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/InstanceLaunchPost202Response.md @@ -0,0 +1,56 @@ +# InstanceLaunchPost202Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Response** | Pointer to **string** | | [optional] + +## Methods + +### NewInstanceLaunchPost202Response + +`func NewInstanceLaunchPost202Response() *InstanceLaunchPost202Response` + +NewInstanceLaunchPost202Response instantiates a new InstanceLaunchPost202Response 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 + +### NewInstanceLaunchPost202ResponseWithDefaults + +`func NewInstanceLaunchPost202ResponseWithDefaults() *InstanceLaunchPost202Response` + +NewInstanceLaunchPost202ResponseWithDefaults instantiates a new InstanceLaunchPost202Response 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 + +### GetResponse + +`func (o *InstanceLaunchPost202Response) GetResponse() string` + +GetResponse returns the Response field if non-nil, zero value otherwise. + +### GetResponseOk + +`func (o *InstanceLaunchPost202Response) GetResponseOk() (*string, bool)` + +GetResponseOk returns a tuple with the Response field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResponse + +`func (o *InstanceLaunchPost202Response) SetResponse(v string)` + +SetResponse sets Response field to given value. + +### HasResponse + +`func (o *InstanceLaunchPost202Response) HasResponse() bool` + +HasResponse 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/InstanceLaunchPostRequest.md b/v1/providers/massedcompute/gen/massedcompute/docs/InstanceLaunchPostRequest.md new file mode 100644 index 0000000..7473863 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/InstanceLaunchPostRequest.md @@ -0,0 +1,197 @@ +# InstanceLaunchPostRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ImageId** | **int32** | The ID of the image to deploy | +**ProductName** | **string** | The product name of the GPU instance you want to deploy. Example = 'gpu_1x_l40' | +**RegionName** | **string** | Set value equal to 'any' | +**InstanceName** | Pointer to **string** | The name of the instance you want to deploy | [optional] +**Coupon** | Pointer to **string** | The coupon code you want to apply to the instance | [optional] +**Command** | Pointer to **string** | The command you want to run on startup | [optional] +**SshKeys** | Pointer to **[]string** | The SSH key you want to use to connect to the instance | [optional] + +## Methods + +### NewInstanceLaunchPostRequest + +`func NewInstanceLaunchPostRequest(imageId int32, productName string, regionName string, ) *InstanceLaunchPostRequest` + +NewInstanceLaunchPostRequest instantiates a new InstanceLaunchPostRequest 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 + +### NewInstanceLaunchPostRequestWithDefaults + +`func NewInstanceLaunchPostRequestWithDefaults() *InstanceLaunchPostRequest` + +NewInstanceLaunchPostRequestWithDefaults instantiates a new InstanceLaunchPostRequest 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 + +### GetImageId + +`func (o *InstanceLaunchPostRequest) GetImageId() int32` + +GetImageId returns the ImageId field if non-nil, zero value otherwise. + +### GetImageIdOk + +`func (o *InstanceLaunchPostRequest) GetImageIdOk() (*int32, bool)` + +GetImageIdOk returns a tuple with the ImageId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetImageId + +`func (o *InstanceLaunchPostRequest) SetImageId(v int32)` + +SetImageId sets ImageId field to given value. + + +### GetProductName + +`func (o *InstanceLaunchPostRequest) GetProductName() string` + +GetProductName returns the ProductName field if non-nil, zero value otherwise. + +### GetProductNameOk + +`func (o *InstanceLaunchPostRequest) GetProductNameOk() (*string, bool)` + +GetProductNameOk returns a tuple with the ProductName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProductName + +`func (o *InstanceLaunchPostRequest) SetProductName(v string)` + +SetProductName sets ProductName field to given value. + + +### GetRegionName + +`func (o *InstanceLaunchPostRequest) GetRegionName() string` + +GetRegionName returns the RegionName field if non-nil, zero value otherwise. + +### GetRegionNameOk + +`func (o *InstanceLaunchPostRequest) GetRegionNameOk() (*string, bool)` + +GetRegionNameOk returns a tuple with the RegionName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRegionName + +`func (o *InstanceLaunchPostRequest) SetRegionName(v string)` + +SetRegionName sets RegionName field to given value. + + +### GetInstanceName + +`func (o *InstanceLaunchPostRequest) GetInstanceName() string` + +GetInstanceName returns the InstanceName field if non-nil, zero value otherwise. + +### GetInstanceNameOk + +`func (o *InstanceLaunchPostRequest) GetInstanceNameOk() (*string, bool)` + +GetInstanceNameOk returns a tuple with the InstanceName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstanceName + +`func (o *InstanceLaunchPostRequest) SetInstanceName(v string)` + +SetInstanceName sets InstanceName field to given value. + +### HasInstanceName + +`func (o *InstanceLaunchPostRequest) HasInstanceName() bool` + +HasInstanceName returns a boolean if a field has been set. + +### GetCoupon + +`func (o *InstanceLaunchPostRequest) GetCoupon() string` + +GetCoupon returns the Coupon field if non-nil, zero value otherwise. + +### GetCouponOk + +`func (o *InstanceLaunchPostRequest) GetCouponOk() (*string, bool)` + +GetCouponOk returns a tuple with the Coupon field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCoupon + +`func (o *InstanceLaunchPostRequest) SetCoupon(v string)` + +SetCoupon sets Coupon field to given value. + +### HasCoupon + +`func (o *InstanceLaunchPostRequest) HasCoupon() bool` + +HasCoupon returns a boolean if a field has been set. + +### GetCommand + +`func (o *InstanceLaunchPostRequest) GetCommand() string` + +GetCommand returns the Command field if non-nil, zero value otherwise. + +### GetCommandOk + +`func (o *InstanceLaunchPostRequest) GetCommandOk() (*string, bool)` + +GetCommandOk returns a tuple with the Command field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCommand + +`func (o *InstanceLaunchPostRequest) SetCommand(v string)` + +SetCommand sets Command field to given value. + +### HasCommand + +`func (o *InstanceLaunchPostRequest) HasCommand() bool` + +HasCommand returns a boolean if a field has been set. + +### GetSshKeys + +`func (o *InstanceLaunchPostRequest) GetSshKeys() []string` + +GetSshKeys returns the SshKeys field if non-nil, zero value otherwise. + +### GetSshKeysOk + +`func (o *InstanceLaunchPostRequest) GetSshKeysOk() (*[]string, bool)` + +GetSshKeysOk returns a tuple with the SshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSshKeys + +`func (o *InstanceLaunchPostRequest) SetSshKeys(v []string)` + +SetSshKeys sets SshKeys field to given value. + +### HasSshKeys + +`func (o *InstanceLaunchPostRequest) HasSshKeys() bool` + +HasSshKeys 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/InstanceRestartPostRequest.md b/v1/providers/massedcompute/gen/massedcompute/docs/InstanceRestartPostRequest.md new file mode 100644 index 0000000..f2320fc --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/InstanceRestartPostRequest.md @@ -0,0 +1,51 @@ +# InstanceRestartPostRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**InstanceUuids** | **[]string** | The ID or IDs of instances to restart | + +## Methods + +### NewInstanceRestartPostRequest + +`func NewInstanceRestartPostRequest(instanceUuids []string, ) *InstanceRestartPostRequest` + +NewInstanceRestartPostRequest instantiates a new InstanceRestartPostRequest 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 + +### NewInstanceRestartPostRequestWithDefaults + +`func NewInstanceRestartPostRequestWithDefaults() *InstanceRestartPostRequest` + +NewInstanceRestartPostRequestWithDefaults instantiates a new InstanceRestartPostRequest 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 + +### GetInstanceUuids + +`func (o *InstanceRestartPostRequest) GetInstanceUuids() []string` + +GetInstanceUuids returns the InstanceUuids field if non-nil, zero value otherwise. + +### GetInstanceUuidsOk + +`func (o *InstanceRestartPostRequest) GetInstanceUuidsOk() (*[]string, bool)` + +GetInstanceUuidsOk returns a tuple with the InstanceUuids field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstanceUuids + +`func (o *InstanceRestartPostRequest) SetInstanceUuids(v []string)` + +SetInstanceUuids sets InstanceUuids 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/InstancesAPI.md b/v1/providers/massedcompute/gen/massedcompute/docs/InstancesAPI.md new file mode 100644 index 0000000..f63123d --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/InstancesAPI.md @@ -0,0 +1,338 @@ +# \InstancesAPI + +All URIs are relative to *https://vm.massedcompute.com/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**InstanceGet**](InstancesAPI.md#InstanceGet) | **Get** /instance | Retrieve list of all running instances. +[**InstanceLaunchPost**](InstancesAPI.md#InstanceLaunchPost) | **Post** /instance/launch | Deploy new instances. +[**InstanceRestartPost**](InstancesAPI.md#InstanceRestartPost) | **Post** /instance/restart | Restart an instances. +[**InstanceTerminatePost**](InstancesAPI.md#InstanceTerminatePost) | **Post** /instance/terminate | Terminate an instances. +[**InstanceUuidGet**](InstancesAPI.md#InstanceUuidGet) | **Get** /instance/{uuid} | Retrieve single running instances. + + + +## InstanceGet + +> RetrieveAllRunningInstancesV1 InstanceGet(ctx).Execute() + +Retrieve list of all running instances. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/brevdev/cloud" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InstancesAPI.InstanceGet(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InstancesAPI.InstanceGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `InstanceGet`: RetrieveAllRunningInstancesV1 + fmt.Fprintf(os.Stdout, "Response from `InstancesAPI.InstanceGet`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiInstanceGetRequest struct via the builder pattern + + +### Return type + +[**RetrieveAllRunningInstancesV1**](RetrieveAllRunningInstancesV1.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) + + +## InstanceLaunchPost + +> InstanceLaunchPost202Response InstanceLaunchPost(ctx).InstanceLaunchPostRequest(instanceLaunchPostRequest).Execute() + +Deploy new instances. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/brevdev/cloud" +) + +func main() { + instanceLaunchPostRequest := *openapiclient.NewInstanceLaunchPostRequest(int32(123), "ProductName_example", "RegionName_example") // InstanceLaunchPostRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InstancesAPI.InstanceLaunchPost(context.Background()).InstanceLaunchPostRequest(instanceLaunchPostRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InstancesAPI.InstanceLaunchPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `InstanceLaunchPost`: InstanceLaunchPost202Response + fmt.Fprintf(os.Stdout, "Response from `InstancesAPI.InstanceLaunchPost`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiInstanceLaunchPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instanceLaunchPostRequest** | [**InstanceLaunchPostRequest**](InstanceLaunchPostRequest.md) | | + +### Return type + +[**InstanceLaunchPost202Response**](InstanceLaunchPost202Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## InstanceRestartPost + +> RestartInstanceV1 InstanceRestartPost(ctx).InstanceRestartPostRequest(instanceRestartPostRequest).Execute() + +Restart an instances. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/brevdev/cloud" +) + +func main() { + instanceRestartPostRequest := *openapiclient.NewInstanceRestartPostRequest([]string{"InstanceUuids_example"}) // InstanceRestartPostRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InstancesAPI.InstanceRestartPost(context.Background()).InstanceRestartPostRequest(instanceRestartPostRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InstancesAPI.InstanceRestartPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `InstanceRestartPost`: RestartInstanceV1 + fmt.Fprintf(os.Stdout, "Response from `InstancesAPI.InstanceRestartPost`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiInstanceRestartPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instanceRestartPostRequest** | [**InstanceRestartPostRequest**](InstanceRestartPostRequest.md) | | + +### Return type + +[**RestartInstanceV1**](RestartInstanceV1.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## InstanceTerminatePost + +> TerminateInstanceV1 InstanceTerminatePost(ctx).InstanceRestartPostRequest(instanceRestartPostRequest).Execute() + +Terminate an instances. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/brevdev/cloud" +) + +func main() { + instanceRestartPostRequest := *openapiclient.NewInstanceRestartPostRequest([]string{"InstanceUuids_example"}) // InstanceRestartPostRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InstancesAPI.InstanceTerminatePost(context.Background()).InstanceRestartPostRequest(instanceRestartPostRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InstancesAPI.InstanceTerminatePost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `InstanceTerminatePost`: TerminateInstanceV1 + fmt.Fprintf(os.Stdout, "Response from `InstancesAPI.InstanceTerminatePost`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiInstanceTerminatePostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instanceRestartPostRequest** | [**InstanceRestartPostRequest**](InstanceRestartPostRequest.md) | | + +### Return type + +[**TerminateInstanceV1**](TerminateInstanceV1.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## InstanceUuidGet + +> RetrieveAllRunningInstancesV1 InstanceUuidGet(ctx, uuid).Execute() + +Retrieve single running instances. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/brevdev/cloud" +) + +func main() { + uuid := "uuid_example" // string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InstancesAPI.InstanceUuidGet(context.Background(), uuid).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InstancesAPI.InstanceUuidGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `InstanceUuidGet`: RetrieveAllRunningInstancesV1 + fmt.Fprintf(os.Stdout, "Response from `InstancesAPI.InstanceUuidGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**uuid** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiInstanceUuidGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**RetrieveAllRunningInstancesV1**](RetrieveAllRunningInstancesV1.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) + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/POSTSSHKey.md b/v1/providers/massedcompute/gen/massedcompute/docs/POSTSSHKey.md new file mode 100644 index 0000000..7c6fab4 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/POSTSSHKey.md @@ -0,0 +1,56 @@ +# POSTSSHKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SshKey** | Pointer to [**POSTSSHKeySshKey**](POSTSSHKeySshKey.md) | | [optional] + +## Methods + +### NewPOSTSSHKey + +`func NewPOSTSSHKey() *POSTSSHKey` + +NewPOSTSSHKey instantiates a new POSTSSHKey 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 + +### NewPOSTSSHKeyWithDefaults + +`func NewPOSTSSHKeyWithDefaults() *POSTSSHKey` + +NewPOSTSSHKeyWithDefaults instantiates a new POSTSSHKey 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 + +### GetSshKey + +`func (o *POSTSSHKey) GetSshKey() POSTSSHKeySshKey` + +GetSshKey returns the SshKey field if non-nil, zero value otherwise. + +### GetSshKeyOk + +`func (o *POSTSSHKey) GetSshKeyOk() (*POSTSSHKeySshKey, bool)` + +GetSshKeyOk returns a tuple with the SshKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSshKey + +`func (o *POSTSSHKey) SetSshKey(v POSTSSHKeySshKey)` + +SetSshKey sets SshKey field to given value. + +### HasSshKey + +`func (o *POSTSSHKey) HasSshKey() bool` + +HasSshKey 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/POSTSSHKeySshKey.md b/v1/providers/massedcompute/gen/massedcompute/docs/POSTSSHKeySshKey.md new file mode 100644 index 0000000..fd01614 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/POSTSSHKeySshKey.md @@ -0,0 +1,82 @@ +# POSTSSHKeySshKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | The unique identifier for the SSH key | [optional] +**Name** | Pointer to **string** | The name of the SSH key | [optional] + +## Methods + +### NewPOSTSSHKeySshKey + +`func NewPOSTSSHKeySshKey() *POSTSSHKeySshKey` + +NewPOSTSSHKeySshKey instantiates a new POSTSSHKeySshKey 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 + +### NewPOSTSSHKeySshKeyWithDefaults + +`func NewPOSTSSHKeySshKeyWithDefaults() *POSTSSHKeySshKey` + +NewPOSTSSHKeySshKeyWithDefaults instantiates a new POSTSSHKeySshKey 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 *POSTSSHKeySshKey) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *POSTSSHKeySshKey) 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 *POSTSSHKeySshKey) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *POSTSSHKeySshKey) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *POSTSSHKeySshKey) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *POSTSSHKeySshKey) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *POSTSSHKeySshKey) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *POSTSSHKeySshKey) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/RestartInstanceV1.md b/v1/providers/massedcompute/gen/massedcompute/docs/RestartInstanceV1.md new file mode 100644 index 0000000..dd1f385 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/RestartInstanceV1.md @@ -0,0 +1,56 @@ +# RestartInstanceV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Response** | Pointer to [**[]RestartInstanceV1ResponseInner**](RestartInstanceV1ResponseInner.md) | | [optional] + +## Methods + +### NewRestartInstanceV1 + +`func NewRestartInstanceV1() *RestartInstanceV1` + +NewRestartInstanceV1 instantiates a new RestartInstanceV1 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 + +### NewRestartInstanceV1WithDefaults + +`func NewRestartInstanceV1WithDefaults() *RestartInstanceV1` + +NewRestartInstanceV1WithDefaults instantiates a new RestartInstanceV1 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 + +### GetResponse + +`func (o *RestartInstanceV1) GetResponse() []RestartInstanceV1ResponseInner` + +GetResponse returns the Response field if non-nil, zero value otherwise. + +### GetResponseOk + +`func (o *RestartInstanceV1) GetResponseOk() (*[]RestartInstanceV1ResponseInner, bool)` + +GetResponseOk returns a tuple with the Response field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResponse + +`func (o *RestartInstanceV1) SetResponse(v []RestartInstanceV1ResponseInner)` + +SetResponse sets Response field to given value. + +### HasResponse + +`func (o *RestartInstanceV1) HasResponse() bool` + +HasResponse 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/RestartInstanceV1ResponseInner.md b/v1/providers/massedcompute/gen/massedcompute/docs/RestartInstanceV1ResponseInner.md new file mode 100644 index 0000000..7c4e373 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/RestartInstanceV1ResponseInner.md @@ -0,0 +1,290 @@ +# RestartInstanceV1ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] +**Ip** | Pointer to **string** | | [optional] +**Status** | Pointer to **string** | | [optional] +**SshKeyNames** | Pointer to **[]string** | | [optional] +**FileSystemNames** | Pointer to **[]string** | | [optional] +**Region** | Pointer to [**RestartInstanceV1ResponseInnerRegion**](RestartInstanceV1ResponseInnerRegion.md) | | [optional] +**InstanceType** | Pointer to [**RestartInstanceV1ResponseInnerInstanceType**](RestartInstanceV1ResponseInnerInstanceType.md) | | [optional] +**JupyterToken** | Pointer to **string** | | [optional] +**JupyterUrl** | Pointer to **string** | | [optional] + +## Methods + +### NewRestartInstanceV1ResponseInner + +`func NewRestartInstanceV1ResponseInner() *RestartInstanceV1ResponseInner` + +NewRestartInstanceV1ResponseInner instantiates a new RestartInstanceV1ResponseInner 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 + +### NewRestartInstanceV1ResponseInnerWithDefaults + +`func NewRestartInstanceV1ResponseInnerWithDefaults() *RestartInstanceV1ResponseInner` + +NewRestartInstanceV1ResponseInnerWithDefaults instantiates a new RestartInstanceV1ResponseInner 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 *RestartInstanceV1ResponseInner) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *RestartInstanceV1ResponseInner) 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 *RestartInstanceV1ResponseInner) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *RestartInstanceV1ResponseInner) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *RestartInstanceV1ResponseInner) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *RestartInstanceV1ResponseInner) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *RestartInstanceV1ResponseInner) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *RestartInstanceV1ResponseInner) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetIp + +`func (o *RestartInstanceV1ResponseInner) GetIp() string` + +GetIp returns the Ip field if non-nil, zero value otherwise. + +### GetIpOk + +`func (o *RestartInstanceV1ResponseInner) GetIpOk() (*string, bool)` + +GetIpOk returns a tuple with the Ip field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIp + +`func (o *RestartInstanceV1ResponseInner) SetIp(v string)` + +SetIp sets Ip field to given value. + +### HasIp + +`func (o *RestartInstanceV1ResponseInner) HasIp() bool` + +HasIp returns a boolean if a field has been set. + +### GetStatus + +`func (o *RestartInstanceV1ResponseInner) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *RestartInstanceV1ResponseInner) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *RestartInstanceV1ResponseInner) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *RestartInstanceV1ResponseInner) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetSshKeyNames + +`func (o *RestartInstanceV1ResponseInner) GetSshKeyNames() []string` + +GetSshKeyNames returns the SshKeyNames field if non-nil, zero value otherwise. + +### GetSshKeyNamesOk + +`func (o *RestartInstanceV1ResponseInner) GetSshKeyNamesOk() (*[]string, bool)` + +GetSshKeyNamesOk returns a tuple with the SshKeyNames field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSshKeyNames + +`func (o *RestartInstanceV1ResponseInner) SetSshKeyNames(v []string)` + +SetSshKeyNames sets SshKeyNames field to given value. + +### HasSshKeyNames + +`func (o *RestartInstanceV1ResponseInner) HasSshKeyNames() bool` + +HasSshKeyNames returns a boolean if a field has been set. + +### GetFileSystemNames + +`func (o *RestartInstanceV1ResponseInner) GetFileSystemNames() []string` + +GetFileSystemNames returns the FileSystemNames field if non-nil, zero value otherwise. + +### GetFileSystemNamesOk + +`func (o *RestartInstanceV1ResponseInner) GetFileSystemNamesOk() (*[]string, bool)` + +GetFileSystemNamesOk returns a tuple with the FileSystemNames field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFileSystemNames + +`func (o *RestartInstanceV1ResponseInner) SetFileSystemNames(v []string)` + +SetFileSystemNames sets FileSystemNames field to given value. + +### HasFileSystemNames + +`func (o *RestartInstanceV1ResponseInner) HasFileSystemNames() bool` + +HasFileSystemNames returns a boolean if a field has been set. + +### GetRegion + +`func (o *RestartInstanceV1ResponseInner) GetRegion() RestartInstanceV1ResponseInnerRegion` + +GetRegion returns the Region field if non-nil, zero value otherwise. + +### GetRegionOk + +`func (o *RestartInstanceV1ResponseInner) GetRegionOk() (*RestartInstanceV1ResponseInnerRegion, bool)` + +GetRegionOk returns a tuple with the Region field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRegion + +`func (o *RestartInstanceV1ResponseInner) SetRegion(v RestartInstanceV1ResponseInnerRegion)` + +SetRegion sets Region field to given value. + +### HasRegion + +`func (o *RestartInstanceV1ResponseInner) HasRegion() bool` + +HasRegion returns a boolean if a field has been set. + +### GetInstanceType + +`func (o *RestartInstanceV1ResponseInner) GetInstanceType() RestartInstanceV1ResponseInnerInstanceType` + +GetInstanceType returns the InstanceType field if non-nil, zero value otherwise. + +### GetInstanceTypeOk + +`func (o *RestartInstanceV1ResponseInner) GetInstanceTypeOk() (*RestartInstanceV1ResponseInnerInstanceType, bool)` + +GetInstanceTypeOk returns a tuple with the InstanceType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstanceType + +`func (o *RestartInstanceV1ResponseInner) SetInstanceType(v RestartInstanceV1ResponseInnerInstanceType)` + +SetInstanceType sets InstanceType field to given value. + +### HasInstanceType + +`func (o *RestartInstanceV1ResponseInner) HasInstanceType() bool` + +HasInstanceType returns a boolean if a field has been set. + +### GetJupyterToken + +`func (o *RestartInstanceV1ResponseInner) GetJupyterToken() string` + +GetJupyterToken returns the JupyterToken field if non-nil, zero value otherwise. + +### GetJupyterTokenOk + +`func (o *RestartInstanceV1ResponseInner) GetJupyterTokenOk() (*string, bool)` + +GetJupyterTokenOk returns a tuple with the JupyterToken field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetJupyterToken + +`func (o *RestartInstanceV1ResponseInner) SetJupyterToken(v string)` + +SetJupyterToken sets JupyterToken field to given value. + +### HasJupyterToken + +`func (o *RestartInstanceV1ResponseInner) HasJupyterToken() bool` + +HasJupyterToken returns a boolean if a field has been set. + +### GetJupyterUrl + +`func (o *RestartInstanceV1ResponseInner) GetJupyterUrl() string` + +GetJupyterUrl returns the JupyterUrl field if non-nil, zero value otherwise. + +### GetJupyterUrlOk + +`func (o *RestartInstanceV1ResponseInner) GetJupyterUrlOk() (*string, bool)` + +GetJupyterUrlOk returns a tuple with the JupyterUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetJupyterUrl + +`func (o *RestartInstanceV1ResponseInner) SetJupyterUrl(v string)` + +SetJupyterUrl sets JupyterUrl field to given value. + +### HasJupyterUrl + +`func (o *RestartInstanceV1ResponseInner) HasJupyterUrl() bool` + +HasJupyterUrl 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/RestartInstanceV1ResponseInnerInstanceType.md b/v1/providers/massedcompute/gen/massedcompute/docs/RestartInstanceV1ResponseInnerInstanceType.md new file mode 100644 index 0000000..58b7819 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/RestartInstanceV1ResponseInnerInstanceType.md @@ -0,0 +1,134 @@ +# RestartInstanceV1ResponseInnerInstanceType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | | [optional] +**Description** | Pointer to **string** | | [optional] +**PriceCentsPerHour** | Pointer to **int32** | | [optional] +**Specs** | Pointer to [**RestartInstanceV1ResponseInnerInstanceTypeSpecs**](RestartInstanceV1ResponseInnerInstanceTypeSpecs.md) | | [optional] + +## Methods + +### NewRestartInstanceV1ResponseInnerInstanceType + +`func NewRestartInstanceV1ResponseInnerInstanceType() *RestartInstanceV1ResponseInnerInstanceType` + +NewRestartInstanceV1ResponseInnerInstanceType instantiates a new RestartInstanceV1ResponseInnerInstanceType 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 + +### NewRestartInstanceV1ResponseInnerInstanceTypeWithDefaults + +`func NewRestartInstanceV1ResponseInnerInstanceTypeWithDefaults() *RestartInstanceV1ResponseInnerInstanceType` + +NewRestartInstanceV1ResponseInnerInstanceTypeWithDefaults instantiates a new RestartInstanceV1ResponseInnerInstanceType object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *RestartInstanceV1ResponseInnerInstanceType) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *RestartInstanceV1ResponseInnerInstanceType) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *RestartInstanceV1ResponseInnerInstanceType) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *RestartInstanceV1ResponseInnerInstanceType) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetDescription + +`func (o *RestartInstanceV1ResponseInnerInstanceType) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *RestartInstanceV1ResponseInnerInstanceType) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *RestartInstanceV1ResponseInnerInstanceType) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *RestartInstanceV1ResponseInnerInstanceType) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetPriceCentsPerHour + +`func (o *RestartInstanceV1ResponseInnerInstanceType) GetPriceCentsPerHour() int32` + +GetPriceCentsPerHour returns the PriceCentsPerHour field if non-nil, zero value otherwise. + +### GetPriceCentsPerHourOk + +`func (o *RestartInstanceV1ResponseInnerInstanceType) GetPriceCentsPerHourOk() (*int32, bool)` + +GetPriceCentsPerHourOk returns a tuple with the PriceCentsPerHour field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPriceCentsPerHour + +`func (o *RestartInstanceV1ResponseInnerInstanceType) SetPriceCentsPerHour(v int32)` + +SetPriceCentsPerHour sets PriceCentsPerHour field to given value. + +### HasPriceCentsPerHour + +`func (o *RestartInstanceV1ResponseInnerInstanceType) HasPriceCentsPerHour() bool` + +HasPriceCentsPerHour returns a boolean if a field has been set. + +### GetSpecs + +`func (o *RestartInstanceV1ResponseInnerInstanceType) GetSpecs() RestartInstanceV1ResponseInnerInstanceTypeSpecs` + +GetSpecs returns the Specs field if non-nil, zero value otherwise. + +### GetSpecsOk + +`func (o *RestartInstanceV1ResponseInnerInstanceType) GetSpecsOk() (*RestartInstanceV1ResponseInnerInstanceTypeSpecs, bool)` + +GetSpecsOk returns a tuple with the Specs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpecs + +`func (o *RestartInstanceV1ResponseInnerInstanceType) SetSpecs(v RestartInstanceV1ResponseInnerInstanceTypeSpecs)` + +SetSpecs sets Specs field to given value. + +### HasSpecs + +`func (o *RestartInstanceV1ResponseInnerInstanceType) HasSpecs() bool` + +HasSpecs 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/RestartInstanceV1ResponseInnerInstanceTypeSpecs.md b/v1/providers/massedcompute/gen/massedcompute/docs/RestartInstanceV1ResponseInnerInstanceTypeSpecs.md new file mode 100644 index 0000000..df6c381 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/RestartInstanceV1ResponseInnerInstanceTypeSpecs.md @@ -0,0 +1,108 @@ +# RestartInstanceV1ResponseInnerInstanceTypeSpecs + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Vcpus** | Pointer to **int32** | | [optional] +**MemoryGib** | Pointer to **int32** | | [optional] +**StorageGb** | Pointer to **int32** | | [optional] + +## Methods + +### NewRestartInstanceV1ResponseInnerInstanceTypeSpecs + +`func NewRestartInstanceV1ResponseInnerInstanceTypeSpecs() *RestartInstanceV1ResponseInnerInstanceTypeSpecs` + +NewRestartInstanceV1ResponseInnerInstanceTypeSpecs instantiates a new RestartInstanceV1ResponseInnerInstanceTypeSpecs 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 + +### NewRestartInstanceV1ResponseInnerInstanceTypeSpecsWithDefaults + +`func NewRestartInstanceV1ResponseInnerInstanceTypeSpecsWithDefaults() *RestartInstanceV1ResponseInnerInstanceTypeSpecs` + +NewRestartInstanceV1ResponseInnerInstanceTypeSpecsWithDefaults instantiates a new RestartInstanceV1ResponseInnerInstanceTypeSpecs 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 + +### GetVcpus + +`func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) GetVcpus() int32` + +GetVcpus returns the Vcpus field if non-nil, zero value otherwise. + +### GetVcpusOk + +`func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) GetVcpusOk() (*int32, bool)` + +GetVcpusOk returns a tuple with the Vcpus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVcpus + +`func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) SetVcpus(v int32)` + +SetVcpus sets Vcpus field to given value. + +### HasVcpus + +`func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) HasVcpus() bool` + +HasVcpus returns a boolean if a field has been set. + +### GetMemoryGib + +`func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) GetMemoryGib() int32` + +GetMemoryGib returns the MemoryGib field if non-nil, zero value otherwise. + +### GetMemoryGibOk + +`func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) GetMemoryGibOk() (*int32, bool)` + +GetMemoryGibOk returns a tuple with the MemoryGib field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemoryGib + +`func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) SetMemoryGib(v int32)` + +SetMemoryGib sets MemoryGib field to given value. + +### HasMemoryGib + +`func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) HasMemoryGib() bool` + +HasMemoryGib returns a boolean if a field has been set. + +### GetStorageGb + +`func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) GetStorageGb() int32` + +GetStorageGb returns the StorageGb field if non-nil, zero value otherwise. + +### GetStorageGbOk + +`func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) GetStorageGbOk() (*int32, bool)` + +GetStorageGbOk returns a tuple with the StorageGb field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStorageGb + +`func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) SetStorageGb(v int32)` + +SetStorageGb sets StorageGb field to given value. + +### HasStorageGb + +`func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) HasStorageGb() bool` + +HasStorageGb 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/RestartInstanceV1ResponseInnerRegion.md b/v1/providers/massedcompute/gen/massedcompute/docs/RestartInstanceV1ResponseInnerRegion.md new file mode 100644 index 0000000..abd1805 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/RestartInstanceV1ResponseInnerRegion.md @@ -0,0 +1,82 @@ +# RestartInstanceV1ResponseInnerRegion + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | | [optional] +**Description** | Pointer to **string** | | [optional] + +## Methods + +### NewRestartInstanceV1ResponseInnerRegion + +`func NewRestartInstanceV1ResponseInnerRegion() *RestartInstanceV1ResponseInnerRegion` + +NewRestartInstanceV1ResponseInnerRegion instantiates a new RestartInstanceV1ResponseInnerRegion 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 + +### NewRestartInstanceV1ResponseInnerRegionWithDefaults + +`func NewRestartInstanceV1ResponseInnerRegionWithDefaults() *RestartInstanceV1ResponseInnerRegion` + +NewRestartInstanceV1ResponseInnerRegionWithDefaults instantiates a new RestartInstanceV1ResponseInnerRegion object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *RestartInstanceV1ResponseInnerRegion) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *RestartInstanceV1ResponseInnerRegion) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *RestartInstanceV1ResponseInnerRegion) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *RestartInstanceV1ResponseInnerRegion) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetDescription + +`func (o *RestartInstanceV1ResponseInnerRegion) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *RestartInstanceV1ResponseInnerRegion) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *RestartInstanceV1ResponseInnerRegion) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *RestartInstanceV1ResponseInnerRegion) HasDescription() bool` + +HasDescription 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAcceptProductsV1.md b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAcceptProductsV1.md new file mode 100644 index 0000000..ff082fb --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAcceptProductsV1.md @@ -0,0 +1,56 @@ +# RetrieveAcceptProductsV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CouponValidation** | Pointer to [**RetrieveAcceptProductsV1CouponValidation**](RetrieveAcceptProductsV1CouponValidation.md) | | [optional] + +## Methods + +### NewRetrieveAcceptProductsV1 + +`func NewRetrieveAcceptProductsV1() *RetrieveAcceptProductsV1` + +NewRetrieveAcceptProductsV1 instantiates a new RetrieveAcceptProductsV1 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 + +### NewRetrieveAcceptProductsV1WithDefaults + +`func NewRetrieveAcceptProductsV1WithDefaults() *RetrieveAcceptProductsV1` + +NewRetrieveAcceptProductsV1WithDefaults instantiates a new RetrieveAcceptProductsV1 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 + +### GetCouponValidation + +`func (o *RetrieveAcceptProductsV1) GetCouponValidation() RetrieveAcceptProductsV1CouponValidation` + +GetCouponValidation returns the CouponValidation field if non-nil, zero value otherwise. + +### GetCouponValidationOk + +`func (o *RetrieveAcceptProductsV1) GetCouponValidationOk() (*RetrieveAcceptProductsV1CouponValidation, bool)` + +GetCouponValidationOk returns a tuple with the CouponValidation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCouponValidation + +`func (o *RetrieveAcceptProductsV1) SetCouponValidation(v RetrieveAcceptProductsV1CouponValidation)` + +SetCouponValidation sets CouponValidation field to given value. + +### HasCouponValidation + +`func (o *RetrieveAcceptProductsV1) HasCouponValidation() bool` + +HasCouponValidation 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAcceptProductsV1CouponValidation.md b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAcceptProductsV1CouponValidation.md new file mode 100644 index 0000000..53febaa --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAcceptProductsV1CouponValidation.md @@ -0,0 +1,82 @@ +# RetrieveAcceptProductsV1CouponValidation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Coupon** | Pointer to [**RetrieveCouponInformationV1Coupon**](RetrieveCouponInformationV1Coupon.md) | | [optional] +**ProductDetails** | Pointer to [**[]RetrieveAcceptProductsV1CouponValidationProductDetailsInner**](RetrieveAcceptProductsV1CouponValidationProductDetailsInner.md) | | [optional] + +## Methods + +### NewRetrieveAcceptProductsV1CouponValidation + +`func NewRetrieveAcceptProductsV1CouponValidation() *RetrieveAcceptProductsV1CouponValidation` + +NewRetrieveAcceptProductsV1CouponValidation instantiates a new RetrieveAcceptProductsV1CouponValidation 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 + +### NewRetrieveAcceptProductsV1CouponValidationWithDefaults + +`func NewRetrieveAcceptProductsV1CouponValidationWithDefaults() *RetrieveAcceptProductsV1CouponValidation` + +NewRetrieveAcceptProductsV1CouponValidationWithDefaults instantiates a new RetrieveAcceptProductsV1CouponValidation 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 + +### GetCoupon + +`func (o *RetrieveAcceptProductsV1CouponValidation) GetCoupon() RetrieveCouponInformationV1Coupon` + +GetCoupon returns the Coupon field if non-nil, zero value otherwise. + +### GetCouponOk + +`func (o *RetrieveAcceptProductsV1CouponValidation) GetCouponOk() (*RetrieveCouponInformationV1Coupon, bool)` + +GetCouponOk returns a tuple with the Coupon field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCoupon + +`func (o *RetrieveAcceptProductsV1CouponValidation) SetCoupon(v RetrieveCouponInformationV1Coupon)` + +SetCoupon sets Coupon field to given value. + +### HasCoupon + +`func (o *RetrieveAcceptProductsV1CouponValidation) HasCoupon() bool` + +HasCoupon returns a boolean if a field has been set. + +### GetProductDetails + +`func (o *RetrieveAcceptProductsV1CouponValidation) GetProductDetails() []RetrieveAcceptProductsV1CouponValidationProductDetailsInner` + +GetProductDetails returns the ProductDetails field if non-nil, zero value otherwise. + +### GetProductDetailsOk + +`func (o *RetrieveAcceptProductsV1CouponValidation) GetProductDetailsOk() (*[]RetrieveAcceptProductsV1CouponValidationProductDetailsInner, bool)` + +GetProductDetailsOk returns a tuple with the ProductDetails field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProductDetails + +`func (o *RetrieveAcceptProductsV1CouponValidation) SetProductDetails(v []RetrieveAcceptProductsV1CouponValidationProductDetailsInner)` + +SetProductDetails sets ProductDetails field to given value. + +### HasProductDetails + +`func (o *RetrieveAcceptProductsV1CouponValidation) HasProductDetails() bool` + +HasProductDetails 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAcceptProductsV1CouponValidationProductDetailsInner.md b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAcceptProductsV1CouponValidationProductDetailsInner.md new file mode 100644 index 0000000..43757da --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAcceptProductsV1CouponValidationProductDetailsInner.md @@ -0,0 +1,134 @@ +# RetrieveAcceptProductsV1CouponValidationProductDetailsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | | [optional] +**Description** | Pointer to **string** | | [optional] +**PricePerHour** | Pointer to **string** | | [optional] +**InventoryAvailable** | Pointer to **bool** | | [optional] + +## Methods + +### NewRetrieveAcceptProductsV1CouponValidationProductDetailsInner + +`func NewRetrieveAcceptProductsV1CouponValidationProductDetailsInner() *RetrieveAcceptProductsV1CouponValidationProductDetailsInner` + +NewRetrieveAcceptProductsV1CouponValidationProductDetailsInner instantiates a new RetrieveAcceptProductsV1CouponValidationProductDetailsInner 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 + +### NewRetrieveAcceptProductsV1CouponValidationProductDetailsInnerWithDefaults + +`func NewRetrieveAcceptProductsV1CouponValidationProductDetailsInnerWithDefaults() *RetrieveAcceptProductsV1CouponValidationProductDetailsInner` + +NewRetrieveAcceptProductsV1CouponValidationProductDetailsInnerWithDefaults instantiates a new RetrieveAcceptProductsV1CouponValidationProductDetailsInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetDescription + +`func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetPricePerHour + +`func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) GetPricePerHour() string` + +GetPricePerHour returns the PricePerHour field if non-nil, zero value otherwise. + +### GetPricePerHourOk + +`func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) GetPricePerHourOk() (*string, bool)` + +GetPricePerHourOk returns a tuple with the PricePerHour field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricePerHour + +`func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) SetPricePerHour(v string)` + +SetPricePerHour sets PricePerHour field to given value. + +### HasPricePerHour + +`func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) HasPricePerHour() bool` + +HasPricePerHour returns a boolean if a field has been set. + +### GetInventoryAvailable + +`func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) GetInventoryAvailable() bool` + +GetInventoryAvailable returns the InventoryAvailable field if non-nil, zero value otherwise. + +### GetInventoryAvailableOk + +`func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) GetInventoryAvailableOk() (*bool, bool)` + +GetInventoryAvailableOk returns a tuple with the InventoryAvailable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInventoryAvailable + +`func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) SetInventoryAvailable(v bool)` + +SetInventoryAvailable sets InventoryAvailable field to given value. + +### HasInventoryAvailable + +`func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) HasInventoryAvailable() bool` + +HasInventoryAvailable 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAllRunningInstancesV1.md b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAllRunningInstancesV1.md new file mode 100644 index 0000000..064c21a --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAllRunningInstancesV1.md @@ -0,0 +1,56 @@ +# RetrieveAllRunningInstancesV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RunningInstances** | Pointer to [**[]RetrieveAllRunningInstancesV1RunningInstancesInner**](RetrieveAllRunningInstancesV1RunningInstancesInner.md) | | [optional] + +## Methods + +### NewRetrieveAllRunningInstancesV1 + +`func NewRetrieveAllRunningInstancesV1() *RetrieveAllRunningInstancesV1` + +NewRetrieveAllRunningInstancesV1 instantiates a new RetrieveAllRunningInstancesV1 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 + +### NewRetrieveAllRunningInstancesV1WithDefaults + +`func NewRetrieveAllRunningInstancesV1WithDefaults() *RetrieveAllRunningInstancesV1` + +NewRetrieveAllRunningInstancesV1WithDefaults instantiates a new RetrieveAllRunningInstancesV1 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 + +### GetRunningInstances + +`func (o *RetrieveAllRunningInstancesV1) GetRunningInstances() []RetrieveAllRunningInstancesV1RunningInstancesInner` + +GetRunningInstances returns the RunningInstances field if non-nil, zero value otherwise. + +### GetRunningInstancesOk + +`func (o *RetrieveAllRunningInstancesV1) GetRunningInstancesOk() (*[]RetrieveAllRunningInstancesV1RunningInstancesInner, bool)` + +GetRunningInstancesOk returns a tuple with the RunningInstances field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRunningInstances + +`func (o *RetrieveAllRunningInstancesV1) SetRunningInstances(v []RetrieveAllRunningInstancesV1RunningInstancesInner)` + +SetRunningInstances sets RunningInstances field to given value. + +### HasRunningInstances + +`func (o *RetrieveAllRunningInstancesV1) HasRunningInstances() bool` + +HasRunningInstances 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAllRunningInstancesV1RunningInstancesInner.md b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAllRunningInstancesV1RunningInstancesInner.md new file mode 100644 index 0000000..b116780 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAllRunningInstancesV1RunningInstancesInner.md @@ -0,0 +1,342 @@ +# RetrieveAllRunningInstancesV1RunningInstancesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] +**Ip** | Pointer to **string** | | [optional] +**Username** | Pointer to **string** | | [optional] +**Password** | Pointer to **string** | | [optional] +**Status** | Pointer to **string** | | [optional] +**OsBooted** | Pointer to **int32** | | [optional] +**CommandStartup** | Pointer to **string** | | [optional] +**Created** | Pointer to **string** | | [optional] +**Active** | Pointer to **int32** | | [optional] +**Image** | Pointer to [**RetrieveAllRunningInstancesV1RunningInstancesInnerImage**](RetrieveAllRunningInstancesV1RunningInstancesInnerImage.md) | | [optional] +**Product** | Pointer to [**RetrieveAllRunningInstancesV1RunningInstancesInnerProduct**](RetrieveAllRunningInstancesV1RunningInstancesInnerProduct.md) | | [optional] + +## Methods + +### NewRetrieveAllRunningInstancesV1RunningInstancesInner + +`func NewRetrieveAllRunningInstancesV1RunningInstancesInner() *RetrieveAllRunningInstancesV1RunningInstancesInner` + +NewRetrieveAllRunningInstancesV1RunningInstancesInner instantiates a new RetrieveAllRunningInstancesV1RunningInstancesInner 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 + +### NewRetrieveAllRunningInstancesV1RunningInstancesInnerWithDefaults + +`func NewRetrieveAllRunningInstancesV1RunningInstancesInnerWithDefaults() *RetrieveAllRunningInstancesV1RunningInstancesInner` + +NewRetrieveAllRunningInstancesV1RunningInstancesInnerWithDefaults instantiates a new RetrieveAllRunningInstancesV1RunningInstancesInner 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 + +### GetUuid + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetUuid() string` + +GetUuid returns the Uuid field if non-nil, zero value otherwise. + +### GetUuidOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetUuidOk() (*string, bool)` + +GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUuid + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetUuid(v string)` + +SetUuid sets Uuid field to given value. + +### HasUuid + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasUuid() bool` + +HasUuid returns a boolean if a field has been set. + +### GetName + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetIp + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetIp() string` + +GetIp returns the Ip field if non-nil, zero value otherwise. + +### GetIpOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetIpOk() (*string, bool)` + +GetIpOk returns a tuple with the Ip field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIp + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetIp(v string)` + +SetIp sets Ip field to given value. + +### HasIp + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasIp() bool` + +HasIp returns a boolean if a field has been set. + +### GetUsername + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetUsername(v string)` + +SetUsername sets Username field to given value. + +### HasUsername + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasUsername() bool` + +HasUsername returns a boolean if a field has been set. + +### GetPassword + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) 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 *RetrieveAllRunningInstancesV1RunningInstancesInner) SetPassword(v string)` + +SetPassword sets Password field to given value. + +### HasPassword + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasPassword() bool` + +HasPassword returns a boolean if a field has been set. + +### GetStatus + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetOsBooted + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetOsBooted() int32` + +GetOsBooted returns the OsBooted field if non-nil, zero value otherwise. + +### GetOsBootedOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetOsBootedOk() (*int32, bool)` + +GetOsBootedOk returns a tuple with the OsBooted field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOsBooted + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetOsBooted(v int32)` + +SetOsBooted sets OsBooted field to given value. + +### HasOsBooted + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasOsBooted() bool` + +HasOsBooted returns a boolean if a field has been set. + +### GetCommandStartup + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetCommandStartup() string` + +GetCommandStartup returns the CommandStartup field if non-nil, zero value otherwise. + +### GetCommandStartupOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetCommandStartupOk() (*string, bool)` + +GetCommandStartupOk returns a tuple with the CommandStartup field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCommandStartup + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetCommandStartup(v string)` + +SetCommandStartup sets CommandStartup field to given value. + +### HasCommandStartup + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasCommandStartup() bool` + +HasCommandStartup returns a boolean if a field has been set. + +### GetCreated + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetCreated() string` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetCreatedOk() (*string, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetCreated(v string)` + +SetCreated sets Created field to given value. + +### HasCreated + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasCreated() bool` + +HasCreated returns a boolean if a field has been set. + +### GetActive + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetActive() int32` + +GetActive returns the Active field if non-nil, zero value otherwise. + +### GetActiveOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetActiveOk() (*int32, 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 *RetrieveAllRunningInstancesV1RunningInstancesInner) SetActive(v int32)` + +SetActive sets Active field to given value. + +### HasActive + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasActive() bool` + +HasActive returns a boolean if a field has been set. + +### GetImage + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetImage() RetrieveAllRunningInstancesV1RunningInstancesInnerImage` + +GetImage returns the Image field if non-nil, zero value otherwise. + +### GetImageOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetImageOk() (*RetrieveAllRunningInstancesV1RunningInstancesInnerImage, bool)` + +GetImageOk returns a tuple with the Image field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetImage + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetImage(v RetrieveAllRunningInstancesV1RunningInstancesInnerImage)` + +SetImage sets Image field to given value. + +### HasImage + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasImage() bool` + +HasImage returns a boolean if a field has been set. + +### GetProduct + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetProduct() RetrieveAllRunningInstancesV1RunningInstancesInnerProduct` + +GetProduct returns the Product field if non-nil, zero value otherwise. + +### GetProductOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetProductOk() (*RetrieveAllRunningInstancesV1RunningInstancesInnerProduct, bool)` + +GetProductOk returns a tuple with the Product field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProduct + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetProduct(v RetrieveAllRunningInstancesV1RunningInstancesInnerProduct)` + +SetProduct sets Product field to given value. + +### HasProduct + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasProduct() bool` + +HasProduct 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAllRunningInstancesV1RunningInstancesInnerImage.md b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAllRunningInstancesV1RunningInstancesInnerImage.md new file mode 100644 index 0000000..c8e74b7 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAllRunningInstancesV1RunningInstancesInnerImage.md @@ -0,0 +1,108 @@ +# RetrieveAllRunningInstancesV1RunningInstancesInnerImage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **int32** | | [optional] +**Name** | Pointer to **string** | | [optional] +**Description** | Pointer to **string** | | [optional] + +## Methods + +### NewRetrieveAllRunningInstancesV1RunningInstancesInnerImage + +`func NewRetrieveAllRunningInstancesV1RunningInstancesInnerImage() *RetrieveAllRunningInstancesV1RunningInstancesInnerImage` + +NewRetrieveAllRunningInstancesV1RunningInstancesInnerImage instantiates a new RetrieveAllRunningInstancesV1RunningInstancesInnerImage 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 + +### NewRetrieveAllRunningInstancesV1RunningInstancesInnerImageWithDefaults + +`func NewRetrieveAllRunningInstancesV1RunningInstancesInnerImageWithDefaults() *RetrieveAllRunningInstancesV1RunningInstancesInnerImage` + +NewRetrieveAllRunningInstancesV1RunningInstancesInnerImageWithDefaults instantiates a new RetrieveAllRunningInstancesV1RunningInstancesInnerImage 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 *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) GetId() int32` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) GetIdOk() (*int32, 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 *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) SetId(v int32)` + +SetId sets Id field to given value. + +### HasId + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetDescription + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) HasDescription() bool` + +HasDescription 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAllRunningInstancesV1RunningInstancesInnerProduct.md b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAllRunningInstancesV1RunningInstancesInnerProduct.md new file mode 100644 index 0000000..ef616bd --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveAllRunningInstancesV1RunningInstancesInnerProduct.md @@ -0,0 +1,238 @@ +# RetrieveAllRunningInstancesV1RunningInstancesInnerProduct + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | | [optional] +**Description** | Pointer to **string** | | [optional] +**GpuCount** | Pointer to **int32** | | [optional] +**Vcpu** | Pointer to **int32** | | [optional] +**Ram** | Pointer to **int32** | | [optional] +**Storage** | Pointer to **int32** | | [optional] +**PriceHr** | Pointer to **string** | | [optional] +**FinalPriceHr** | Pointer to **string** | | [optional] + +## Methods + +### NewRetrieveAllRunningInstancesV1RunningInstancesInnerProduct + +`func NewRetrieveAllRunningInstancesV1RunningInstancesInnerProduct() *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct` + +NewRetrieveAllRunningInstancesV1RunningInstancesInnerProduct instantiates a new RetrieveAllRunningInstancesV1RunningInstancesInnerProduct 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 + +### NewRetrieveAllRunningInstancesV1RunningInstancesInnerProductWithDefaults + +`func NewRetrieveAllRunningInstancesV1RunningInstancesInnerProductWithDefaults() *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct` + +NewRetrieveAllRunningInstancesV1RunningInstancesInnerProductWithDefaults instantiates a new RetrieveAllRunningInstancesV1RunningInstancesInnerProduct object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetDescription + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetGpuCount + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetGpuCount() int32` + +GetGpuCount returns the GpuCount field if non-nil, zero value otherwise. + +### GetGpuCountOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetGpuCountOk() (*int32, bool)` + +GetGpuCountOk returns a tuple with the GpuCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGpuCount + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) SetGpuCount(v int32)` + +SetGpuCount sets GpuCount field to given value. + +### HasGpuCount + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) HasGpuCount() bool` + +HasGpuCount returns a boolean if a field has been set. + +### GetVcpu + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetVcpu() int32` + +GetVcpu returns the Vcpu field if non-nil, zero value otherwise. + +### GetVcpuOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetVcpuOk() (*int32, bool)` + +GetVcpuOk returns a tuple with the Vcpu field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVcpu + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) SetVcpu(v int32)` + +SetVcpu sets Vcpu field to given value. + +### HasVcpu + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) HasVcpu() bool` + +HasVcpu returns a boolean if a field has been set. + +### GetRam + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetRam() int32` + +GetRam returns the Ram field if non-nil, zero value otherwise. + +### GetRamOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetRamOk() (*int32, bool)` + +GetRamOk returns a tuple with the Ram field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRam + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) SetRam(v int32)` + +SetRam sets Ram field to given value. + +### HasRam + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) HasRam() bool` + +HasRam returns a boolean if a field has been set. + +### GetStorage + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetStorage() int32` + +GetStorage returns the Storage field if non-nil, zero value otherwise. + +### GetStorageOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetStorageOk() (*int32, bool)` + +GetStorageOk returns a tuple with the Storage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStorage + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) SetStorage(v int32)` + +SetStorage sets Storage field to given value. + +### HasStorage + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) HasStorage() bool` + +HasStorage returns a boolean if a field has been set. + +### GetPriceHr + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetPriceHr() string` + +GetPriceHr returns the PriceHr field if non-nil, zero value otherwise. + +### GetPriceHrOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetPriceHrOk() (*string, bool)` + +GetPriceHrOk returns a tuple with the PriceHr field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPriceHr + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) SetPriceHr(v string)` + +SetPriceHr sets PriceHr field to given value. + +### HasPriceHr + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) HasPriceHr() bool` + +HasPriceHr returns a boolean if a field has been set. + +### GetFinalPriceHr + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetFinalPriceHr() string` + +GetFinalPriceHr returns the FinalPriceHr field if non-nil, zero value otherwise. + +### GetFinalPriceHrOk + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetFinalPriceHrOk() (*string, bool)` + +GetFinalPriceHrOk returns a tuple with the FinalPriceHr field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFinalPriceHr + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) SetFinalPriceHr(v string)` + +SetFinalPriceHr sets FinalPriceHr field to given value. + +### HasFinalPriceHr + +`func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) HasFinalPriceHr() bool` + +HasFinalPriceHr 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveBillingInformationV1.md b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveBillingInformationV1.md new file mode 100644 index 0000000..3866ec1 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveBillingInformationV1.md @@ -0,0 +1,160 @@ +# RetrieveBillingInformationV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BillingMethod** | Pointer to **string** | | [optional] +**RechargeThresholdCents** | Pointer to **int32** | | [optional] +**RechargeThreshold** | Pointer to **string** | | [optional] +**RechargeAmountCents** | Pointer to **int32** | | [optional] +**RechargeAmount** | Pointer to **string** | | [optional] + +## Methods + +### NewRetrieveBillingInformationV1 + +`func NewRetrieveBillingInformationV1() *RetrieveBillingInformationV1` + +NewRetrieveBillingInformationV1 instantiates a new RetrieveBillingInformationV1 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 + +### NewRetrieveBillingInformationV1WithDefaults + +`func NewRetrieveBillingInformationV1WithDefaults() *RetrieveBillingInformationV1` + +NewRetrieveBillingInformationV1WithDefaults instantiates a new RetrieveBillingInformationV1 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 + +### GetBillingMethod + +`func (o *RetrieveBillingInformationV1) GetBillingMethod() string` + +GetBillingMethod returns the BillingMethod field if non-nil, zero value otherwise. + +### GetBillingMethodOk + +`func (o *RetrieveBillingInformationV1) GetBillingMethodOk() (*string, bool)` + +GetBillingMethodOk returns a tuple with the BillingMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingMethod + +`func (o *RetrieveBillingInformationV1) SetBillingMethod(v string)` + +SetBillingMethod sets BillingMethod field to given value. + +### HasBillingMethod + +`func (o *RetrieveBillingInformationV1) HasBillingMethod() bool` + +HasBillingMethod returns a boolean if a field has been set. + +### GetRechargeThresholdCents + +`func (o *RetrieveBillingInformationV1) GetRechargeThresholdCents() int32` + +GetRechargeThresholdCents returns the RechargeThresholdCents field if non-nil, zero value otherwise. + +### GetRechargeThresholdCentsOk + +`func (o *RetrieveBillingInformationV1) GetRechargeThresholdCentsOk() (*int32, bool)` + +GetRechargeThresholdCentsOk returns a tuple with the RechargeThresholdCents field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRechargeThresholdCents + +`func (o *RetrieveBillingInformationV1) SetRechargeThresholdCents(v int32)` + +SetRechargeThresholdCents sets RechargeThresholdCents field to given value. + +### HasRechargeThresholdCents + +`func (o *RetrieveBillingInformationV1) HasRechargeThresholdCents() bool` + +HasRechargeThresholdCents returns a boolean if a field has been set. + +### GetRechargeThreshold + +`func (o *RetrieveBillingInformationV1) GetRechargeThreshold() string` + +GetRechargeThreshold returns the RechargeThreshold field if non-nil, zero value otherwise. + +### GetRechargeThresholdOk + +`func (o *RetrieveBillingInformationV1) GetRechargeThresholdOk() (*string, bool)` + +GetRechargeThresholdOk returns a tuple with the RechargeThreshold field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRechargeThreshold + +`func (o *RetrieveBillingInformationV1) SetRechargeThreshold(v string)` + +SetRechargeThreshold sets RechargeThreshold field to given value. + +### HasRechargeThreshold + +`func (o *RetrieveBillingInformationV1) HasRechargeThreshold() bool` + +HasRechargeThreshold returns a boolean if a field has been set. + +### GetRechargeAmountCents + +`func (o *RetrieveBillingInformationV1) GetRechargeAmountCents() int32` + +GetRechargeAmountCents returns the RechargeAmountCents field if non-nil, zero value otherwise. + +### GetRechargeAmountCentsOk + +`func (o *RetrieveBillingInformationV1) GetRechargeAmountCentsOk() (*int32, bool)` + +GetRechargeAmountCentsOk returns a tuple with the RechargeAmountCents field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRechargeAmountCents + +`func (o *RetrieveBillingInformationV1) SetRechargeAmountCents(v int32)` + +SetRechargeAmountCents sets RechargeAmountCents field to given value. + +### HasRechargeAmountCents + +`func (o *RetrieveBillingInformationV1) HasRechargeAmountCents() bool` + +HasRechargeAmountCents returns a boolean if a field has been set. + +### GetRechargeAmount + +`func (o *RetrieveBillingInformationV1) GetRechargeAmount() string` + +GetRechargeAmount returns the RechargeAmount field if non-nil, zero value otherwise. + +### GetRechargeAmountOk + +`func (o *RetrieveBillingInformationV1) GetRechargeAmountOk() (*string, bool)` + +GetRechargeAmountOk returns a tuple with the RechargeAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRechargeAmount + +`func (o *RetrieveBillingInformationV1) SetRechargeAmount(v string)` + +SetRechargeAmount sets RechargeAmount field to given value. + +### HasRechargeAmount + +`func (o *RetrieveBillingInformationV1) HasRechargeAmount() bool` + +HasRechargeAmount 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveCouponInformationV1.md b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveCouponInformationV1.md new file mode 100644 index 0000000..071bce1 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveCouponInformationV1.md @@ -0,0 +1,56 @@ +# RetrieveCouponInformationV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Coupon** | Pointer to [**RetrieveCouponInformationV1Coupon**](RetrieveCouponInformationV1Coupon.md) | | [optional] + +## Methods + +### NewRetrieveCouponInformationV1 + +`func NewRetrieveCouponInformationV1() *RetrieveCouponInformationV1` + +NewRetrieveCouponInformationV1 instantiates a new RetrieveCouponInformationV1 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 + +### NewRetrieveCouponInformationV1WithDefaults + +`func NewRetrieveCouponInformationV1WithDefaults() *RetrieveCouponInformationV1` + +NewRetrieveCouponInformationV1WithDefaults instantiates a new RetrieveCouponInformationV1 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 + +### GetCoupon + +`func (o *RetrieveCouponInformationV1) GetCoupon() RetrieveCouponInformationV1Coupon` + +GetCoupon returns the Coupon field if non-nil, zero value otherwise. + +### GetCouponOk + +`func (o *RetrieveCouponInformationV1) GetCouponOk() (*RetrieveCouponInformationV1Coupon, bool)` + +GetCouponOk returns a tuple with the Coupon field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCoupon + +`func (o *RetrieveCouponInformationV1) SetCoupon(v RetrieveCouponInformationV1Coupon)` + +SetCoupon sets Coupon field to given value. + +### HasCoupon + +`func (o *RetrieveCouponInformationV1) HasCoupon() bool` + +HasCoupon 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveCouponInformationV1Coupon.md b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveCouponInformationV1Coupon.md new file mode 100644 index 0000000..84613d1 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveCouponInformationV1Coupon.md @@ -0,0 +1,108 @@ +# RetrieveCouponInformationV1Coupon + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **string** | | [optional] +**DiscountPercent** | Pointer to **string** | | [optional] +**DeactivationDate** | Pointer to **string** | | [optional] + +## Methods + +### NewRetrieveCouponInformationV1Coupon + +`func NewRetrieveCouponInformationV1Coupon() *RetrieveCouponInformationV1Coupon` + +NewRetrieveCouponInformationV1Coupon instantiates a new RetrieveCouponInformationV1Coupon 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 + +### NewRetrieveCouponInformationV1CouponWithDefaults + +`func NewRetrieveCouponInformationV1CouponWithDefaults() *RetrieveCouponInformationV1Coupon` + +NewRetrieveCouponInformationV1CouponWithDefaults instantiates a new RetrieveCouponInformationV1Coupon 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 *RetrieveCouponInformationV1Coupon) GetCode() string` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *RetrieveCouponInformationV1Coupon) 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 *RetrieveCouponInformationV1Coupon) SetCode(v string)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *RetrieveCouponInformationV1Coupon) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetDiscountPercent + +`func (o *RetrieveCouponInformationV1Coupon) GetDiscountPercent() string` + +GetDiscountPercent returns the DiscountPercent field if non-nil, zero value otherwise. + +### GetDiscountPercentOk + +`func (o *RetrieveCouponInformationV1Coupon) GetDiscountPercentOk() (*string, bool)` + +GetDiscountPercentOk returns a tuple with the DiscountPercent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDiscountPercent + +`func (o *RetrieveCouponInformationV1Coupon) SetDiscountPercent(v string)` + +SetDiscountPercent sets DiscountPercent field to given value. + +### HasDiscountPercent + +`func (o *RetrieveCouponInformationV1Coupon) HasDiscountPercent() bool` + +HasDiscountPercent returns a boolean if a field has been set. + +### GetDeactivationDate + +`func (o *RetrieveCouponInformationV1Coupon) GetDeactivationDate() string` + +GetDeactivationDate returns the DeactivationDate field if non-nil, zero value otherwise. + +### GetDeactivationDateOk + +`func (o *RetrieveCouponInformationV1Coupon) GetDeactivationDateOk() (*string, bool)` + +GetDeactivationDateOk returns a tuple with the DeactivationDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeactivationDate + +`func (o *RetrieveCouponInformationV1Coupon) SetDeactivationDate(v string)` + +SetDeactivationDate sets DeactivationDate field to given value. + +### HasDeactivationDate + +`func (o *RetrieveCouponInformationV1Coupon) HasDeactivationDate() bool` + +HasDeactivationDate 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveSingleRunningInstanceV1.md b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveSingleRunningInstanceV1.md new file mode 100644 index 0000000..231500e --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveSingleRunningInstanceV1.md @@ -0,0 +1,56 @@ +# RetrieveSingleRunningInstanceV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RunningInstance** | Pointer to [**RetrieveSingleRunningInstanceV1RunningInstance**](RetrieveSingleRunningInstanceV1RunningInstance.md) | | [optional] + +## Methods + +### NewRetrieveSingleRunningInstanceV1 + +`func NewRetrieveSingleRunningInstanceV1() *RetrieveSingleRunningInstanceV1` + +NewRetrieveSingleRunningInstanceV1 instantiates a new RetrieveSingleRunningInstanceV1 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 + +### NewRetrieveSingleRunningInstanceV1WithDefaults + +`func NewRetrieveSingleRunningInstanceV1WithDefaults() *RetrieveSingleRunningInstanceV1` + +NewRetrieveSingleRunningInstanceV1WithDefaults instantiates a new RetrieveSingleRunningInstanceV1 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 + +### GetRunningInstance + +`func (o *RetrieveSingleRunningInstanceV1) GetRunningInstance() RetrieveSingleRunningInstanceV1RunningInstance` + +GetRunningInstance returns the RunningInstance field if non-nil, zero value otherwise. + +### GetRunningInstanceOk + +`func (o *RetrieveSingleRunningInstanceV1) GetRunningInstanceOk() (*RetrieveSingleRunningInstanceV1RunningInstance, bool)` + +GetRunningInstanceOk returns a tuple with the RunningInstance field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRunningInstance + +`func (o *RetrieveSingleRunningInstanceV1) SetRunningInstance(v RetrieveSingleRunningInstanceV1RunningInstance)` + +SetRunningInstance sets RunningInstance field to given value. + +### HasRunningInstance + +`func (o *RetrieveSingleRunningInstanceV1) HasRunningInstance() bool` + +HasRunningInstance 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveSingleRunningInstanceV1RunningInstance.md b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveSingleRunningInstanceV1RunningInstance.md new file mode 100644 index 0000000..a21598a --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveSingleRunningInstanceV1RunningInstance.md @@ -0,0 +1,342 @@ +# RetrieveSingleRunningInstanceV1RunningInstance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] +**Ip** | Pointer to **string** | | [optional] +**Username** | Pointer to **string** | | [optional] +**Password** | Pointer to **string** | | [optional] +**Status** | Pointer to **string** | | [optional] +**OsBooted** | Pointer to **int32** | | [optional] +**CommandStartup** | Pointer to **string** | | [optional] +**Created** | Pointer to **string** | | [optional] +**Active** | Pointer to **int32** | | [optional] +**Image** | Pointer to [**RetrieveAllRunningInstancesV1RunningInstancesInnerImage**](RetrieveAllRunningInstancesV1RunningInstancesInnerImage.md) | | [optional] +**Product** | Pointer to [**RetrieveSingleRunningInstanceV1RunningInstanceProduct**](RetrieveSingleRunningInstanceV1RunningInstanceProduct.md) | | [optional] + +## Methods + +### NewRetrieveSingleRunningInstanceV1RunningInstance + +`func NewRetrieveSingleRunningInstanceV1RunningInstance() *RetrieveSingleRunningInstanceV1RunningInstance` + +NewRetrieveSingleRunningInstanceV1RunningInstance instantiates a new RetrieveSingleRunningInstanceV1RunningInstance 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 + +### NewRetrieveSingleRunningInstanceV1RunningInstanceWithDefaults + +`func NewRetrieveSingleRunningInstanceV1RunningInstanceWithDefaults() *RetrieveSingleRunningInstanceV1RunningInstance` + +NewRetrieveSingleRunningInstanceV1RunningInstanceWithDefaults instantiates a new RetrieveSingleRunningInstanceV1RunningInstance 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 + +### GetUuid + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetUuid() string` + +GetUuid returns the Uuid field if non-nil, zero value otherwise. + +### GetUuidOk + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetUuidOk() (*string, bool)` + +GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUuid + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetUuid(v string)` + +SetUuid sets Uuid field to given value. + +### HasUuid + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasUuid() bool` + +HasUuid returns a boolean if a field has been set. + +### GetName + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetIp + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetIp() string` + +GetIp returns the Ip field if non-nil, zero value otherwise. + +### GetIpOk + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetIpOk() (*string, bool)` + +GetIpOk returns a tuple with the Ip field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIp + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetIp(v string)` + +SetIp sets Ip field to given value. + +### HasIp + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasIp() bool` + +HasIp returns a boolean if a field has been set. + +### GetUsername + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetUsername(v string)` + +SetUsername sets Username field to given value. + +### HasUsername + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasUsername() bool` + +HasUsername returns a boolean if a field has been set. + +### GetPassword + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) 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 *RetrieveSingleRunningInstanceV1RunningInstance) SetPassword(v string)` + +SetPassword sets Password field to given value. + +### HasPassword + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasPassword() bool` + +HasPassword returns a boolean if a field has been set. + +### GetStatus + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetOsBooted + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetOsBooted() int32` + +GetOsBooted returns the OsBooted field if non-nil, zero value otherwise. + +### GetOsBootedOk + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetOsBootedOk() (*int32, bool)` + +GetOsBootedOk returns a tuple with the OsBooted field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOsBooted + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetOsBooted(v int32)` + +SetOsBooted sets OsBooted field to given value. + +### HasOsBooted + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasOsBooted() bool` + +HasOsBooted returns a boolean if a field has been set. + +### GetCommandStartup + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetCommandStartup() string` + +GetCommandStartup returns the CommandStartup field if non-nil, zero value otherwise. + +### GetCommandStartupOk + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetCommandStartupOk() (*string, bool)` + +GetCommandStartupOk returns a tuple with the CommandStartup field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCommandStartup + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetCommandStartup(v string)` + +SetCommandStartup sets CommandStartup field to given value. + +### HasCommandStartup + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasCommandStartup() bool` + +HasCommandStartup returns a boolean if a field has been set. + +### GetCreated + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetCreated() string` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetCreatedOk() (*string, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetCreated(v string)` + +SetCreated sets Created field to given value. + +### HasCreated + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasCreated() bool` + +HasCreated returns a boolean if a field has been set. + +### GetActive + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetActive() int32` + +GetActive returns the Active field if non-nil, zero value otherwise. + +### GetActiveOk + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetActiveOk() (*int32, 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 *RetrieveSingleRunningInstanceV1RunningInstance) SetActive(v int32)` + +SetActive sets Active field to given value. + +### HasActive + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasActive() bool` + +HasActive returns a boolean if a field has been set. + +### GetImage + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetImage() RetrieveAllRunningInstancesV1RunningInstancesInnerImage` + +GetImage returns the Image field if non-nil, zero value otherwise. + +### GetImageOk + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetImageOk() (*RetrieveAllRunningInstancesV1RunningInstancesInnerImage, bool)` + +GetImageOk returns a tuple with the Image field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetImage + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetImage(v RetrieveAllRunningInstancesV1RunningInstancesInnerImage)` + +SetImage sets Image field to given value. + +### HasImage + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasImage() bool` + +HasImage returns a boolean if a field has been set. + +### GetProduct + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetProduct() RetrieveSingleRunningInstanceV1RunningInstanceProduct` + +GetProduct returns the Product field if non-nil, zero value otherwise. + +### GetProductOk + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetProductOk() (*RetrieveSingleRunningInstanceV1RunningInstanceProduct, bool)` + +GetProductOk returns a tuple with the Product field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProduct + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetProduct(v RetrieveSingleRunningInstanceV1RunningInstanceProduct)` + +SetProduct sets Product field to given value. + +### HasProduct + +`func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasProduct() bool` + +HasProduct 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveSingleRunningInstanceV1RunningInstanceProduct.md b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveSingleRunningInstanceV1RunningInstanceProduct.md new file mode 100644 index 0000000..3b0779f --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/RetrieveSingleRunningInstanceV1RunningInstanceProduct.md @@ -0,0 +1,238 @@ +# RetrieveSingleRunningInstanceV1RunningInstanceProduct + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | | [optional] +**Description** | Pointer to **string** | | [optional] +**GpuCount** | Pointer to **int32** | | [optional] +**Vcpu** | Pointer to **int32** | | [optional] +**Ram** | Pointer to **int32** | | [optional] +**Storage** | Pointer to **int32** | | [optional] +**PriceHr** | Pointer to **string** | | [optional] +**FinalPriceHr** | Pointer to **string** | | [optional] + +## Methods + +### NewRetrieveSingleRunningInstanceV1RunningInstanceProduct + +`func NewRetrieveSingleRunningInstanceV1RunningInstanceProduct() *RetrieveSingleRunningInstanceV1RunningInstanceProduct` + +NewRetrieveSingleRunningInstanceV1RunningInstanceProduct instantiates a new RetrieveSingleRunningInstanceV1RunningInstanceProduct 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 + +### NewRetrieveSingleRunningInstanceV1RunningInstanceProductWithDefaults + +`func NewRetrieveSingleRunningInstanceV1RunningInstanceProductWithDefaults() *RetrieveSingleRunningInstanceV1RunningInstanceProduct` + +NewRetrieveSingleRunningInstanceV1RunningInstanceProductWithDefaults instantiates a new RetrieveSingleRunningInstanceV1RunningInstanceProduct object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetDescription + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetGpuCount + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetGpuCount() int32` + +GetGpuCount returns the GpuCount field if non-nil, zero value otherwise. + +### GetGpuCountOk + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetGpuCountOk() (*int32, bool)` + +GetGpuCountOk returns a tuple with the GpuCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGpuCount + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) SetGpuCount(v int32)` + +SetGpuCount sets GpuCount field to given value. + +### HasGpuCount + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) HasGpuCount() bool` + +HasGpuCount returns a boolean if a field has been set. + +### GetVcpu + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetVcpu() int32` + +GetVcpu returns the Vcpu field if non-nil, zero value otherwise. + +### GetVcpuOk + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetVcpuOk() (*int32, bool)` + +GetVcpuOk returns a tuple with the Vcpu field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVcpu + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) SetVcpu(v int32)` + +SetVcpu sets Vcpu field to given value. + +### HasVcpu + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) HasVcpu() bool` + +HasVcpu returns a boolean if a field has been set. + +### GetRam + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetRam() int32` + +GetRam returns the Ram field if non-nil, zero value otherwise. + +### GetRamOk + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetRamOk() (*int32, bool)` + +GetRamOk returns a tuple with the Ram field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRam + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) SetRam(v int32)` + +SetRam sets Ram field to given value. + +### HasRam + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) HasRam() bool` + +HasRam returns a boolean if a field has been set. + +### GetStorage + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetStorage() int32` + +GetStorage returns the Storage field if non-nil, zero value otherwise. + +### GetStorageOk + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetStorageOk() (*int32, bool)` + +GetStorageOk returns a tuple with the Storage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStorage + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) SetStorage(v int32)` + +SetStorage sets Storage field to given value. + +### HasStorage + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) HasStorage() bool` + +HasStorage returns a boolean if a field has been set. + +### GetPriceHr + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetPriceHr() string` + +GetPriceHr returns the PriceHr field if non-nil, zero value otherwise. + +### GetPriceHrOk + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetPriceHrOk() (*string, bool)` + +GetPriceHrOk returns a tuple with the PriceHr field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPriceHr + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) SetPriceHr(v string)` + +SetPriceHr sets PriceHr field to given value. + +### HasPriceHr + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) HasPriceHr() bool` + +HasPriceHr returns a boolean if a field has been set. + +### GetFinalPriceHr + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetFinalPriceHr() string` + +GetFinalPriceHr returns the FinalPriceHr field if non-nil, zero value otherwise. + +### GetFinalPriceHrOk + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetFinalPriceHrOk() (*string, bool)` + +GetFinalPriceHrOk returns a tuple with the FinalPriceHr field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFinalPriceHr + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) SetFinalPriceHr(v string)` + +SetFinalPriceHr sets FinalPriceHr field to given value. + +### HasFinalPriceHr + +`func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) HasFinalPriceHr() bool` + +HasFinalPriceHr 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/SSHKey.md b/v1/providers/massedcompute/gen/massedcompute/docs/SSHKey.md new file mode 100644 index 0000000..d04985b --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/SSHKey.md @@ -0,0 +1,56 @@ +# SSHKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SshKeys** | Pointer to [**[]SSHKeyItem**](SSHKeyItem.md) | | [optional] + +## Methods + +### NewSSHKey + +`func NewSSHKey() *SSHKey` + +NewSSHKey instantiates a new SSHKey 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 + +### NewSSHKeyWithDefaults + +`func NewSSHKeyWithDefaults() *SSHKey` + +NewSSHKeyWithDefaults instantiates a new SSHKey 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 + +### GetSshKeys + +`func (o *SSHKey) GetSshKeys() []SSHKeyItem` + +GetSshKeys returns the SshKeys field if non-nil, zero value otherwise. + +### GetSshKeysOk + +`func (o *SSHKey) GetSshKeysOk() (*[]SSHKeyItem, bool)` + +GetSshKeysOk returns a tuple with the SshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSshKeys + +`func (o *SSHKey) SetSshKeys(v []SSHKeyItem)` + +SetSshKeys sets SshKeys field to given value. + +### HasSshKeys + +`func (o *SSHKey) HasSshKeys() bool` + +HasSshKeys 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/SSHKeyItem.md b/v1/providers/massedcompute/gen/massedcompute/docs/SSHKeyItem.md new file mode 100644 index 0000000..f7589e3 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/SSHKeyItem.md @@ -0,0 +1,108 @@ +# SSHKeyItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | The unique identifier for the SSH key | [optional] +**Name** | Pointer to **string** | The name of the SSH key | [optional] +**PublicKey** | Pointer to **string** | The public key associated with the SSH key | [optional] + +## Methods + +### NewSSHKeyItem + +`func NewSSHKeyItem() *SSHKeyItem` + +NewSSHKeyItem instantiates a new SSHKeyItem 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 + +### NewSSHKeyItemWithDefaults + +`func NewSSHKeyItemWithDefaults() *SSHKeyItem` + +NewSSHKeyItemWithDefaults instantiates a new SSHKeyItem 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 *SSHKeyItem) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *SSHKeyItem) 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 *SSHKeyItem) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *SSHKeyItem) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *SSHKeyItem) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *SSHKeyItem) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *SSHKeyItem) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *SSHKeyItem) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetPublicKey + +`func (o *SSHKeyItem) GetPublicKey() string` + +GetPublicKey returns the PublicKey field if non-nil, zero value otherwise. + +### GetPublicKeyOk + +`func (o *SSHKeyItem) 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 *SSHKeyItem) SetPublicKey(v string)` + +SetPublicKey sets PublicKey field to given value. + +### HasPublicKey + +`func (o *SSHKeyItem) HasPublicKey() bool` + +HasPublicKey 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/SSHKeysAPI.md b/v1/providers/massedcompute/gen/massedcompute/docs/SSHKeysAPI.md new file mode 100644 index 0000000..c0051ba --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/SSHKeysAPI.md @@ -0,0 +1,208 @@ +# \SSHKeysAPI + +All URIs are relative to *https://vm.massedcompute.com/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**SshKeysGet**](SSHKeysAPI.md#SshKeysGet) | **Get** /ssh-keys | Retrieve SSH keys associated with the account. +[**SshKeysIdDelete**](SSHKeysAPI.md#SshKeysIdDelete) | **Delete** /ssh-keys/{id} | Remove an SSH key from the account. +[**SshKeysPost**](SSHKeysAPI.md#SshKeysPost) | **Post** /ssh-keys | Add an SSH key to the account. + + + +## SshKeysGet + +> SSHKey SshKeysGet(ctx).Execute() + +Retrieve SSH keys associated with the account. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/brevdev/cloud" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SSHKeysAPI.SshKeysGet(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SSHKeysAPI.SshKeysGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `SshKeysGet`: SSHKey + fmt.Fprintf(os.Stdout, "Response from `SSHKeysAPI.SshKeysGet`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiSshKeysGetRequest struct via the builder pattern + + +### Return type + +[**SSHKey**](SSHKey.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) + + +## SshKeysIdDelete + +> SshKeysIdDelete200Response SshKeysIdDelete(ctx, id).Execute() + +Remove an SSH key from the account. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/brevdev/cloud" +) + +func main() { + id := "id_example" // string | The unique identifier for the SSH key to be removed + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SSHKeysAPI.SshKeysIdDelete(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SSHKeysAPI.SshKeysIdDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `SshKeysIdDelete`: SshKeysIdDelete200Response + fmt.Fprintf(os.Stdout, "Response from `SSHKeysAPI.SshKeysIdDelete`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | The unique identifier for the SSH key to be removed | + +### Other Parameters + +Other parameters are passed through a pointer to a apiSshKeysIdDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**SshKeysIdDelete200Response**](SshKeysIdDelete200Response.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) + + +## SshKeysPost + +> POSTSSHKey SshKeysPost(ctx).SshKeysPostRequest(sshKeysPostRequest).Execute() + +Add an SSH key to the account. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/brevdev/cloud" +) + +func main() { + sshKeysPostRequest := *openapiclient.NewSshKeysPostRequest("Name_example", "PublicKey_example") // SshKeysPostRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SSHKeysAPI.SshKeysPost(context.Background()).SshKeysPostRequest(sshKeysPostRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SSHKeysAPI.SshKeysPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `SshKeysPost`: POSTSSHKey + fmt.Fprintf(os.Stdout, "Response from `SSHKeysAPI.SshKeysPost`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiSshKeysPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sshKeysPostRequest** | [**SshKeysPostRequest**](SshKeysPostRequest.md) | | + +### Return type + +[**POSTSSHKey**](POSTSSHKey.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/SshKeysIdDelete200Response.md b/v1/providers/massedcompute/gen/massedcompute/docs/SshKeysIdDelete200Response.md new file mode 100644 index 0000000..310caa7 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/SshKeysIdDelete200Response.md @@ -0,0 +1,56 @@ +# SshKeysIdDelete200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | Pointer to **map[string]interface{}** | | [optional] + +## Methods + +### NewSshKeysIdDelete200Response + +`func NewSshKeysIdDelete200Response() *SshKeysIdDelete200Response` + +NewSshKeysIdDelete200Response instantiates a new SshKeysIdDelete200Response 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 + +### NewSshKeysIdDelete200ResponseWithDefaults + +`func NewSshKeysIdDelete200ResponseWithDefaults() *SshKeysIdDelete200Response` + +NewSshKeysIdDelete200ResponseWithDefaults instantiates a new SshKeysIdDelete200Response 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 + +### GetResult + +`func (o *SshKeysIdDelete200Response) GetResult() map[string]interface{}` + +GetResult returns the Result field if non-nil, zero value otherwise. + +### GetResultOk + +`func (o *SshKeysIdDelete200Response) GetResultOk() (*map[string]interface{}, bool)` + +GetResultOk returns a tuple with the Result field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResult + +`func (o *SshKeysIdDelete200Response) SetResult(v map[string]interface{})` + +SetResult sets Result field to given value. + +### HasResult + +`func (o *SshKeysIdDelete200Response) HasResult() bool` + +HasResult 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/SshKeysPostRequest.md b/v1/providers/massedcompute/gen/massedcompute/docs/SshKeysPostRequest.md new file mode 100644 index 0000000..d72ff52 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/SshKeysPostRequest.md @@ -0,0 +1,72 @@ +# SshKeysPostRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the SSH key | +**PublicKey** | **string** | The public key associated with the SSH key | + +## Methods + +### NewSshKeysPostRequest + +`func NewSshKeysPostRequest(name string, publicKey string, ) *SshKeysPostRequest` + +NewSshKeysPostRequest instantiates a new SshKeysPostRequest 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 + +### NewSshKeysPostRequestWithDefaults + +`func NewSshKeysPostRequestWithDefaults() *SshKeysPostRequest` + +NewSshKeysPostRequestWithDefaults instantiates a new SshKeysPostRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *SshKeysPostRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *SshKeysPostRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *SshKeysPostRequest) SetName(v string)` + +SetName sets Name field to given value. + + +### GetPublicKey + +`func (o *SshKeysPostRequest) GetPublicKey() string` + +GetPublicKey returns the PublicKey field if non-nil, zero value otherwise. + +### GetPublicKeyOk + +`func (o *SshKeysPostRequest) 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 *SshKeysPostRequest) SetPublicKey(v string)` + +SetPublicKey sets PublicKey field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/TerminateInstanceV1.md b/v1/providers/massedcompute/gen/massedcompute/docs/TerminateInstanceV1.md new file mode 100644 index 0000000..6b38270 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/TerminateInstanceV1.md @@ -0,0 +1,56 @@ +# TerminateInstanceV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Response** | Pointer to [**TerminateInstanceV1Response**](TerminateInstanceV1Response.md) | | [optional] + +## Methods + +### NewTerminateInstanceV1 + +`func NewTerminateInstanceV1() *TerminateInstanceV1` + +NewTerminateInstanceV1 instantiates a new TerminateInstanceV1 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 + +### NewTerminateInstanceV1WithDefaults + +`func NewTerminateInstanceV1WithDefaults() *TerminateInstanceV1` + +NewTerminateInstanceV1WithDefaults instantiates a new TerminateInstanceV1 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 + +### GetResponse + +`func (o *TerminateInstanceV1) GetResponse() TerminateInstanceV1Response` + +GetResponse returns the Response field if non-nil, zero value otherwise. + +### GetResponseOk + +`func (o *TerminateInstanceV1) GetResponseOk() (*TerminateInstanceV1Response, bool)` + +GetResponseOk returns a tuple with the Response field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResponse + +`func (o *TerminateInstanceV1) SetResponse(v TerminateInstanceV1Response)` + +SetResponse sets Response field to given value. + +### HasResponse + +`func (o *TerminateInstanceV1) HasResponse() bool` + +HasResponse 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/TerminateInstanceV1Response.md b/v1/providers/massedcompute/gen/massedcompute/docs/TerminateInstanceV1Response.md new file mode 100644 index 0000000..7f38abc --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/TerminateInstanceV1Response.md @@ -0,0 +1,56 @@ +# TerminateInstanceV1Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | Pointer to [**TerminateInstanceV1ResponseData**](TerminateInstanceV1ResponseData.md) | | [optional] + +## Methods + +### NewTerminateInstanceV1Response + +`func NewTerminateInstanceV1Response() *TerminateInstanceV1Response` + +NewTerminateInstanceV1Response instantiates a new TerminateInstanceV1Response 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 + +### NewTerminateInstanceV1ResponseWithDefaults + +`func NewTerminateInstanceV1ResponseWithDefaults() *TerminateInstanceV1Response` + +NewTerminateInstanceV1ResponseWithDefaults instantiates a new TerminateInstanceV1Response 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 + +### GetData + +`func (o *TerminateInstanceV1Response) GetData() TerminateInstanceV1ResponseData` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *TerminateInstanceV1Response) GetDataOk() (*TerminateInstanceV1ResponseData, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *TerminateInstanceV1Response) SetData(v TerminateInstanceV1ResponseData)` + +SetData sets Data field to given value. + +### HasData + +`func (o *TerminateInstanceV1Response) HasData() bool` + +HasData 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/TerminateInstanceV1ResponseData.md b/v1/providers/massedcompute/gen/massedcompute/docs/TerminateInstanceV1ResponseData.md new file mode 100644 index 0000000..01f3502 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/TerminateInstanceV1ResponseData.md @@ -0,0 +1,56 @@ +# TerminateInstanceV1ResponseData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TerminatedInstances** | Pointer to [**[]TerminateInstanceV1ResponseDataTerminatedInstancesInner**](TerminateInstanceV1ResponseDataTerminatedInstancesInner.md) | | [optional] + +## Methods + +### NewTerminateInstanceV1ResponseData + +`func NewTerminateInstanceV1ResponseData() *TerminateInstanceV1ResponseData` + +NewTerminateInstanceV1ResponseData instantiates a new TerminateInstanceV1ResponseData 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 + +### NewTerminateInstanceV1ResponseDataWithDefaults + +`func NewTerminateInstanceV1ResponseDataWithDefaults() *TerminateInstanceV1ResponseData` + +NewTerminateInstanceV1ResponseDataWithDefaults instantiates a new TerminateInstanceV1ResponseData 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 + +### GetTerminatedInstances + +`func (o *TerminateInstanceV1ResponseData) GetTerminatedInstances() []TerminateInstanceV1ResponseDataTerminatedInstancesInner` + +GetTerminatedInstances returns the TerminatedInstances field if non-nil, zero value otherwise. + +### GetTerminatedInstancesOk + +`func (o *TerminateInstanceV1ResponseData) GetTerminatedInstancesOk() (*[]TerminateInstanceV1ResponseDataTerminatedInstancesInner, bool)` + +GetTerminatedInstancesOk returns a tuple with the TerminatedInstances field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTerminatedInstances + +`func (o *TerminateInstanceV1ResponseData) SetTerminatedInstances(v []TerminateInstanceV1ResponseDataTerminatedInstancesInner)` + +SetTerminatedInstances sets TerminatedInstances field to given value. + +### HasTerminatedInstances + +`func (o *TerminateInstanceV1ResponseData) HasTerminatedInstances() bool` + +HasTerminatedInstances 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/docs/TerminateInstanceV1ResponseDataTerminatedInstancesInner.md b/v1/providers/massedcompute/gen/massedcompute/docs/TerminateInstanceV1ResponseDataTerminatedInstancesInner.md new file mode 100644 index 0000000..2c5bcba --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/docs/TerminateInstanceV1ResponseDataTerminatedInstancesInner.md @@ -0,0 +1,290 @@ +# TerminateInstanceV1ResponseDataTerminatedInstancesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] +**Ip** | Pointer to **string** | | [optional] +**Status** | Pointer to **string** | | [optional] +**SshKeyNames** | Pointer to **[]string** | | [optional] +**FileSystemNames** | Pointer to **[]string** | | [optional] +**Region** | Pointer to [**RestartInstanceV1ResponseInnerRegion**](RestartInstanceV1ResponseInnerRegion.md) | | [optional] +**InstanceType** | Pointer to [**RestartInstanceV1ResponseInnerInstanceType**](RestartInstanceV1ResponseInnerInstanceType.md) | | [optional] +**JupyterToken** | Pointer to **string** | | [optional] +**JupyterUrl** | Pointer to **string** | | [optional] + +## Methods + +### NewTerminateInstanceV1ResponseDataTerminatedInstancesInner + +`func NewTerminateInstanceV1ResponseDataTerminatedInstancesInner() *TerminateInstanceV1ResponseDataTerminatedInstancesInner` + +NewTerminateInstanceV1ResponseDataTerminatedInstancesInner instantiates a new TerminateInstanceV1ResponseDataTerminatedInstancesInner 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 + +### NewTerminateInstanceV1ResponseDataTerminatedInstancesInnerWithDefaults + +`func NewTerminateInstanceV1ResponseDataTerminatedInstancesInnerWithDefaults() *TerminateInstanceV1ResponseDataTerminatedInstancesInner` + +NewTerminateInstanceV1ResponseDataTerminatedInstancesInnerWithDefaults instantiates a new TerminateInstanceV1ResponseDataTerminatedInstancesInner 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 *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) 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 *TerminateInstanceV1ResponseDataTerminatedInstancesInner) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetIp + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetIp() string` + +GetIp returns the Ip field if non-nil, zero value otherwise. + +### GetIpOk + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetIpOk() (*string, bool)` + +GetIpOk returns a tuple with the Ip field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIp + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) SetIp(v string)` + +SetIp sets Ip field to given value. + +### HasIp + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) HasIp() bool` + +HasIp returns a boolean if a field has been set. + +### GetStatus + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetSshKeyNames + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetSshKeyNames() []string` + +GetSshKeyNames returns the SshKeyNames field if non-nil, zero value otherwise. + +### GetSshKeyNamesOk + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetSshKeyNamesOk() (*[]string, bool)` + +GetSshKeyNamesOk returns a tuple with the SshKeyNames field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSshKeyNames + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) SetSshKeyNames(v []string)` + +SetSshKeyNames sets SshKeyNames field to given value. + +### HasSshKeyNames + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) HasSshKeyNames() bool` + +HasSshKeyNames returns a boolean if a field has been set. + +### GetFileSystemNames + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetFileSystemNames() []string` + +GetFileSystemNames returns the FileSystemNames field if non-nil, zero value otherwise. + +### GetFileSystemNamesOk + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetFileSystemNamesOk() (*[]string, bool)` + +GetFileSystemNamesOk returns a tuple with the FileSystemNames field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFileSystemNames + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) SetFileSystemNames(v []string)` + +SetFileSystemNames sets FileSystemNames field to given value. + +### HasFileSystemNames + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) HasFileSystemNames() bool` + +HasFileSystemNames returns a boolean if a field has been set. + +### GetRegion + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetRegion() RestartInstanceV1ResponseInnerRegion` + +GetRegion returns the Region field if non-nil, zero value otherwise. + +### GetRegionOk + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetRegionOk() (*RestartInstanceV1ResponseInnerRegion, bool)` + +GetRegionOk returns a tuple with the Region field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRegion + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) SetRegion(v RestartInstanceV1ResponseInnerRegion)` + +SetRegion sets Region field to given value. + +### HasRegion + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) HasRegion() bool` + +HasRegion returns a boolean if a field has been set. + +### GetInstanceType + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetInstanceType() RestartInstanceV1ResponseInnerInstanceType` + +GetInstanceType returns the InstanceType field if non-nil, zero value otherwise. + +### GetInstanceTypeOk + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetInstanceTypeOk() (*RestartInstanceV1ResponseInnerInstanceType, bool)` + +GetInstanceTypeOk returns a tuple with the InstanceType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstanceType + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) SetInstanceType(v RestartInstanceV1ResponseInnerInstanceType)` + +SetInstanceType sets InstanceType field to given value. + +### HasInstanceType + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) HasInstanceType() bool` + +HasInstanceType returns a boolean if a field has been set. + +### GetJupyterToken + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetJupyterToken() string` + +GetJupyterToken returns the JupyterToken field if non-nil, zero value otherwise. + +### GetJupyterTokenOk + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetJupyterTokenOk() (*string, bool)` + +GetJupyterTokenOk returns a tuple with the JupyterToken field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetJupyterToken + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) SetJupyterToken(v string)` + +SetJupyterToken sets JupyterToken field to given value. + +### HasJupyterToken + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) HasJupyterToken() bool` + +HasJupyterToken returns a boolean if a field has been set. + +### GetJupyterUrl + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetJupyterUrl() string` + +GetJupyterUrl returns the JupyterUrl field if non-nil, zero value otherwise. + +### GetJupyterUrlOk + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetJupyterUrlOk() (*string, bool)` + +GetJupyterUrlOk returns a tuple with the JupyterUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetJupyterUrl + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) SetJupyterUrl(v string)` + +SetJupyterUrl sets JupyterUrl field to given value. + +### HasJupyterUrl + +`func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) HasJupyterUrl() bool` + +HasJupyterUrl 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) + + diff --git a/v1/providers/massedcompute/gen/massedcompute/git_push.sh b/v1/providers/massedcompute/gen/massedcompute/git_push.sh new file mode 100644 index 0000000..ccffd50 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="brevdev" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cloud" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/v1/providers/massedcompute/gen/massedcompute/model__account_token_validation_post_200_response.go b/v1/providers/massedcompute/gen/massedcompute/model__account_token_validation_post_200_response.go new file mode 100644 index 0000000..8e20fec --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model__account_token_validation_post_200_response.go @@ -0,0 +1,153 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the AccountTokenValidationPost200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AccountTokenValidationPost200Response{} + +// AccountTokenValidationPost200Response struct for AccountTokenValidationPost200Response +type AccountTokenValidationPost200Response struct { + Message *string `json:"message,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AccountTokenValidationPost200Response AccountTokenValidationPost200Response + +// NewAccountTokenValidationPost200Response instantiates a new AccountTokenValidationPost200Response 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 NewAccountTokenValidationPost200Response() *AccountTokenValidationPost200Response { + this := AccountTokenValidationPost200Response{} + return &this +} + +// NewAccountTokenValidationPost200ResponseWithDefaults instantiates a new AccountTokenValidationPost200Response 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 NewAccountTokenValidationPost200ResponseWithDefaults() *AccountTokenValidationPost200Response { + this := AccountTokenValidationPost200Response{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *AccountTokenValidationPost200Response) 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 *AccountTokenValidationPost200Response) 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 *AccountTokenValidationPost200Response) 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 *AccountTokenValidationPost200Response) SetMessage(v string) { + o.Message = &v +} + +func (o AccountTokenValidationPost200Response) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AccountTokenValidationPost200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AccountTokenValidationPost200Response) UnmarshalJSON(data []byte) (err error) { + varAccountTokenValidationPost200Response := _AccountTokenValidationPost200Response{} + + err = json.Unmarshal(data, &varAccountTokenValidationPost200Response) + + if err != nil { + return err + } + + *o = AccountTokenValidationPost200Response(varAccountTokenValidationPost200Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAccountTokenValidationPost200Response struct { + value *AccountTokenValidationPost200Response + isSet bool +} + +func (v NullableAccountTokenValidationPost200Response) Get() *AccountTokenValidationPost200Response { + return v.value +} + +func (v *NullableAccountTokenValidationPost200Response) Set(val *AccountTokenValidationPost200Response) { + v.value = val + v.isSet = true +} + +func (v NullableAccountTokenValidationPost200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableAccountTokenValidationPost200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccountTokenValidationPost200Response(val *AccountTokenValidationPost200Response) *NullableAccountTokenValidationPost200Response { + return &NullableAccountTokenValidationPost200Response{value: val, isSet: true} +} + +func (v NullableAccountTokenValidationPost200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccountTokenValidationPost200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model__coupon_information_post_request.go b/v1/providers/massedcompute/gen/massedcompute/model__coupon_information_post_request.go new file mode 100644 index 0000000..8c6518f --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model__coupon_information_post_request.go @@ -0,0 +1,154 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the CouponInformationPostRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CouponInformationPostRequest{} + +// CouponInformationPostRequest struct for CouponInformationPostRequest +type CouponInformationPostRequest struct { + // The coupon code you want to retrieve information about + Coupon *string `json:"coupon,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CouponInformationPostRequest CouponInformationPostRequest + +// NewCouponInformationPostRequest instantiates a new CouponInformationPostRequest 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 NewCouponInformationPostRequest() *CouponInformationPostRequest { + this := CouponInformationPostRequest{} + return &this +} + +// NewCouponInformationPostRequestWithDefaults instantiates a new CouponInformationPostRequest 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 NewCouponInformationPostRequestWithDefaults() *CouponInformationPostRequest { + this := CouponInformationPostRequest{} + return &this +} + +// GetCoupon returns the Coupon field value if set, zero value otherwise. +func (o *CouponInformationPostRequest) GetCoupon() string { + if o == nil || IsNil(o.Coupon) { + var ret string + return ret + } + return *o.Coupon +} + +// GetCouponOk returns a tuple with the Coupon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CouponInformationPostRequest) GetCouponOk() (*string, bool) { + if o == nil || IsNil(o.Coupon) { + return nil, false + } + return o.Coupon, true +} + +// HasCoupon returns a boolean if a field has been set. +func (o *CouponInformationPostRequest) HasCoupon() bool { + if o != nil && !IsNil(o.Coupon) { + return true + } + + return false +} + +// SetCoupon gets a reference to the given string and assigns it to the Coupon field. +func (o *CouponInformationPostRequest) SetCoupon(v string) { + o.Coupon = &v +} + +func (o CouponInformationPostRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CouponInformationPostRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Coupon) { + toSerialize["coupon"] = o.Coupon + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CouponInformationPostRequest) UnmarshalJSON(data []byte) (err error) { + varCouponInformationPostRequest := _CouponInformationPostRequest{} + + err = json.Unmarshal(data, &varCouponInformationPostRequest) + + if err != nil { + return err + } + + *o = CouponInformationPostRequest(varCouponInformationPostRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "coupon") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCouponInformationPostRequest struct { + value *CouponInformationPostRequest + isSet bool +} + +func (v NullableCouponInformationPostRequest) Get() *CouponInformationPostRequest { + return v.value +} + +func (v *NullableCouponInformationPostRequest) Set(val *CouponInformationPostRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCouponInformationPostRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCouponInformationPostRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCouponInformationPostRequest(val *CouponInformationPostRequest) *NullableCouponInformationPostRequest { + return &NullableCouponInformationPostRequest{value: val, isSet: true} +} + +func (v NullableCouponInformationPostRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCouponInformationPostRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model__instance_launch_post_202_response.go b/v1/providers/massedcompute/gen/massedcompute/model__instance_launch_post_202_response.go new file mode 100644 index 0000000..2273555 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model__instance_launch_post_202_response.go @@ -0,0 +1,153 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the InstanceLaunchPost202Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceLaunchPost202Response{} + +// InstanceLaunchPost202Response struct for InstanceLaunchPost202Response +type InstanceLaunchPost202Response struct { + Response *string `json:"response,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InstanceLaunchPost202Response InstanceLaunchPost202Response + +// NewInstanceLaunchPost202Response instantiates a new InstanceLaunchPost202Response 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 NewInstanceLaunchPost202Response() *InstanceLaunchPost202Response { + this := InstanceLaunchPost202Response{} + return &this +} + +// NewInstanceLaunchPost202ResponseWithDefaults instantiates a new InstanceLaunchPost202Response 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 NewInstanceLaunchPost202ResponseWithDefaults() *InstanceLaunchPost202Response { + this := InstanceLaunchPost202Response{} + return &this +} + +// GetResponse returns the Response field value if set, zero value otherwise. +func (o *InstanceLaunchPost202Response) GetResponse() string { + if o == nil || IsNil(o.Response) { + var ret string + return ret + } + return *o.Response +} + +// GetResponseOk returns a tuple with the Response field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceLaunchPost202Response) GetResponseOk() (*string, bool) { + if o == nil || IsNil(o.Response) { + return nil, false + } + return o.Response, true +} + +// HasResponse returns a boolean if a field has been set. +func (o *InstanceLaunchPost202Response) HasResponse() bool { + if o != nil && !IsNil(o.Response) { + return true + } + + return false +} + +// SetResponse gets a reference to the given string and assigns it to the Response field. +func (o *InstanceLaunchPost202Response) SetResponse(v string) { + o.Response = &v +} + +func (o InstanceLaunchPost202Response) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceLaunchPost202Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Response) { + toSerialize["response"] = o.Response + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceLaunchPost202Response) UnmarshalJSON(data []byte) (err error) { + varInstanceLaunchPost202Response := _InstanceLaunchPost202Response{} + + err = json.Unmarshal(data, &varInstanceLaunchPost202Response) + + if err != nil { + return err + } + + *o = InstanceLaunchPost202Response(varInstanceLaunchPost202Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "response") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceLaunchPost202Response struct { + value *InstanceLaunchPost202Response + isSet bool +} + +func (v NullableInstanceLaunchPost202Response) Get() *InstanceLaunchPost202Response { + return v.value +} + +func (v *NullableInstanceLaunchPost202Response) Set(val *InstanceLaunchPost202Response) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLaunchPost202Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLaunchPost202Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLaunchPost202Response(val *InstanceLaunchPost202Response) *NullableInstanceLaunchPost202Response { + return &NullableInstanceLaunchPost202Response{value: val, isSet: true} +} + +func (v NullableInstanceLaunchPost202Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLaunchPost202Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model__instance_launch_post_request.go b/v1/providers/massedcompute/gen/massedcompute/model__instance_launch_post_request.go new file mode 100644 index 0000000..1d9d843 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model__instance_launch_post_request.go @@ -0,0 +1,379 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceLaunchPostRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceLaunchPostRequest{} + +// InstanceLaunchPostRequest struct for InstanceLaunchPostRequest +type InstanceLaunchPostRequest struct { + // The ID of the image to deploy + ImageId int32 `json:"imageId"` + // The product name of the GPU instance you want to deploy. Example = 'gpu_1x_l40' + ProductName string `json:"productName"` + // Set value equal to 'any' + RegionName string `json:"regionName"` + // The name of the instance you want to deploy + InstanceName *string `json:"instanceName,omitempty"` + // The coupon code you want to apply to the instance + Coupon *string `json:"coupon,omitempty"` + // The command you want to run on startup + Command *string `json:"command,omitempty"` + // The SSH key you want to use to connect to the instance + SshKeys []string `json:"sshKeys,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InstanceLaunchPostRequest InstanceLaunchPostRequest + +// NewInstanceLaunchPostRequest instantiates a new InstanceLaunchPostRequest 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 NewInstanceLaunchPostRequest(imageId int32, productName string, regionName string) *InstanceLaunchPostRequest { + this := InstanceLaunchPostRequest{} + this.ImageId = imageId + this.ProductName = productName + this.RegionName = regionName + return &this +} + +// NewInstanceLaunchPostRequestWithDefaults instantiates a new InstanceLaunchPostRequest 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 NewInstanceLaunchPostRequestWithDefaults() *InstanceLaunchPostRequest { + this := InstanceLaunchPostRequest{} + return &this +} + +// GetImageId returns the ImageId field value +func (o *InstanceLaunchPostRequest) GetImageId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ImageId +} + +// GetImageIdOk returns a tuple with the ImageId field value +// and a boolean to check if the value has been set. +func (o *InstanceLaunchPostRequest) GetImageIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ImageId, true +} + +// SetImageId sets field value +func (o *InstanceLaunchPostRequest) SetImageId(v int32) { + o.ImageId = v +} + +// GetProductName returns the ProductName field value +func (o *InstanceLaunchPostRequest) GetProductName() string { + if o == nil { + var ret string + return ret + } + + return o.ProductName +} + +// GetProductNameOk returns a tuple with the ProductName field value +// and a boolean to check if the value has been set. +func (o *InstanceLaunchPostRequest) GetProductNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ProductName, true +} + +// SetProductName sets field value +func (o *InstanceLaunchPostRequest) SetProductName(v string) { + o.ProductName = v +} + +// GetRegionName returns the RegionName field value +func (o *InstanceLaunchPostRequest) GetRegionName() string { + if o == nil { + var ret string + return ret + } + + return o.RegionName +} + +// GetRegionNameOk returns a tuple with the RegionName field value +// and a boolean to check if the value has been set. +func (o *InstanceLaunchPostRequest) GetRegionNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RegionName, true +} + +// SetRegionName sets field value +func (o *InstanceLaunchPostRequest) SetRegionName(v string) { + o.RegionName = v +} + +// GetInstanceName returns the InstanceName field value if set, zero value otherwise. +func (o *InstanceLaunchPostRequest) GetInstanceName() string { + if o == nil || IsNil(o.InstanceName) { + var ret string + return ret + } + return *o.InstanceName +} + +// GetInstanceNameOk returns a tuple with the InstanceName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceLaunchPostRequest) GetInstanceNameOk() (*string, bool) { + if o == nil || IsNil(o.InstanceName) { + return nil, false + } + return o.InstanceName, true +} + +// HasInstanceName returns a boolean if a field has been set. +func (o *InstanceLaunchPostRequest) HasInstanceName() bool { + if o != nil && !IsNil(o.InstanceName) { + return true + } + + return false +} + +// SetInstanceName gets a reference to the given string and assigns it to the InstanceName field. +func (o *InstanceLaunchPostRequest) SetInstanceName(v string) { + o.InstanceName = &v +} + +// GetCoupon returns the Coupon field value if set, zero value otherwise. +func (o *InstanceLaunchPostRequest) GetCoupon() string { + if o == nil || IsNil(o.Coupon) { + var ret string + return ret + } + return *o.Coupon +} + +// GetCouponOk returns a tuple with the Coupon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceLaunchPostRequest) GetCouponOk() (*string, bool) { + if o == nil || IsNil(o.Coupon) { + return nil, false + } + return o.Coupon, true +} + +// HasCoupon returns a boolean if a field has been set. +func (o *InstanceLaunchPostRequest) HasCoupon() bool { + if o != nil && !IsNil(o.Coupon) { + return true + } + + return false +} + +// SetCoupon gets a reference to the given string and assigns it to the Coupon field. +func (o *InstanceLaunchPostRequest) SetCoupon(v string) { + o.Coupon = &v +} + +// GetCommand returns the Command field value if set, zero value otherwise. +func (o *InstanceLaunchPostRequest) GetCommand() string { + if o == nil || IsNil(o.Command) { + var ret string + return ret + } + return *o.Command +} + +// GetCommandOk returns a tuple with the Command field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceLaunchPostRequest) GetCommandOk() (*string, bool) { + if o == nil || IsNil(o.Command) { + return nil, false + } + return o.Command, true +} + +// HasCommand returns a boolean if a field has been set. +func (o *InstanceLaunchPostRequest) HasCommand() bool { + if o != nil && !IsNil(o.Command) { + return true + } + + return false +} + +// SetCommand gets a reference to the given string and assigns it to the Command field. +func (o *InstanceLaunchPostRequest) SetCommand(v string) { + o.Command = &v +} + +// GetSshKeys returns the SshKeys field value if set, zero value otherwise. +func (o *InstanceLaunchPostRequest) GetSshKeys() []string { + if o == nil || IsNil(o.SshKeys) { + var ret []string + return ret + } + return o.SshKeys +} + +// GetSshKeysOk returns a tuple with the SshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceLaunchPostRequest) GetSshKeysOk() ([]string, bool) { + if o == nil || IsNil(o.SshKeys) { + return nil, false + } + return o.SshKeys, true +} + +// HasSshKeys returns a boolean if a field has been set. +func (o *InstanceLaunchPostRequest) HasSshKeys() bool { + if o != nil && !IsNil(o.SshKeys) { + return true + } + + return false +} + +// SetSshKeys gets a reference to the given []string and assigns it to the SshKeys field. +func (o *InstanceLaunchPostRequest) SetSshKeys(v []string) { + o.SshKeys = v +} + +func (o InstanceLaunchPostRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceLaunchPostRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["imageId"] = o.ImageId + toSerialize["productName"] = o.ProductName + toSerialize["regionName"] = o.RegionName + if !IsNil(o.InstanceName) { + toSerialize["instanceName"] = o.InstanceName + } + if !IsNil(o.Coupon) { + toSerialize["coupon"] = o.Coupon + } + if !IsNil(o.Command) { + toSerialize["command"] = o.Command + } + if !IsNil(o.SshKeys) { + toSerialize["sshKeys"] = o.SshKeys + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceLaunchPostRequest) 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{ + "imageId", + "productName", + "regionName", + } + + 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) + } + } + + varInstanceLaunchPostRequest := _InstanceLaunchPostRequest{} + + err = json.Unmarshal(data, &varInstanceLaunchPostRequest) + + if err != nil { + return err + } + + *o = InstanceLaunchPostRequest(varInstanceLaunchPostRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "imageId") + delete(additionalProperties, "productName") + delete(additionalProperties, "regionName") + delete(additionalProperties, "instanceName") + delete(additionalProperties, "coupon") + delete(additionalProperties, "command") + delete(additionalProperties, "sshKeys") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceLaunchPostRequest struct { + value *InstanceLaunchPostRequest + isSet bool +} + +func (v NullableInstanceLaunchPostRequest) Get() *InstanceLaunchPostRequest { + return v.value +} + +func (v *NullableInstanceLaunchPostRequest) Set(val *InstanceLaunchPostRequest) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLaunchPostRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLaunchPostRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLaunchPostRequest(val *InstanceLaunchPostRequest) *NullableInstanceLaunchPostRequest { + return &NullableInstanceLaunchPostRequest{value: val, isSet: true} +} + +func (v NullableInstanceLaunchPostRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLaunchPostRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model__instance_restart_post_request.go b/v1/providers/massedcompute/gen/massedcompute/model__instance_restart_post_request.go new file mode 100644 index 0000000..103de39 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model__instance_restart_post_request.go @@ -0,0 +1,167 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceRestartPostRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceRestartPostRequest{} + +// InstanceRestartPostRequest struct for InstanceRestartPostRequest +type InstanceRestartPostRequest struct { + // The ID or IDs of instances to restart + InstanceUuids []string `json:"instanceUuids"` + AdditionalProperties map[string]interface{} +} + +type _InstanceRestartPostRequest InstanceRestartPostRequest + +// NewInstanceRestartPostRequest instantiates a new InstanceRestartPostRequest 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 NewInstanceRestartPostRequest(instanceUuids []string) *InstanceRestartPostRequest { + this := InstanceRestartPostRequest{} + this.InstanceUuids = instanceUuids + return &this +} + +// NewInstanceRestartPostRequestWithDefaults instantiates a new InstanceRestartPostRequest 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 NewInstanceRestartPostRequestWithDefaults() *InstanceRestartPostRequest { + this := InstanceRestartPostRequest{} + return &this +} + +// GetInstanceUuids returns the InstanceUuids field value +func (o *InstanceRestartPostRequest) GetInstanceUuids() []string { + if o == nil { + var ret []string + return ret + } + + return o.InstanceUuids +} + +// GetInstanceUuidsOk returns a tuple with the InstanceUuids field value +// and a boolean to check if the value has been set. +func (o *InstanceRestartPostRequest) GetInstanceUuidsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.InstanceUuids, true +} + +// SetInstanceUuids sets field value +func (o *InstanceRestartPostRequest) SetInstanceUuids(v []string) { + o.InstanceUuids = v +} + +func (o InstanceRestartPostRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceRestartPostRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceUuids"] = o.InstanceUuids + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceRestartPostRequest) 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{ + "instanceUuids", + } + + 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) + } + } + + varInstanceRestartPostRequest := _InstanceRestartPostRequest{} + + err = json.Unmarshal(data, &varInstanceRestartPostRequest) + + if err != nil { + return err + } + + *o = InstanceRestartPostRequest(varInstanceRestartPostRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceUuids") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceRestartPostRequest struct { + value *InstanceRestartPostRequest + isSet bool +} + +func (v NullableInstanceRestartPostRequest) Get() *InstanceRestartPostRequest { + return v.value +} + +func (v *NullableInstanceRestartPostRequest) Set(val *InstanceRestartPostRequest) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceRestartPostRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceRestartPostRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceRestartPostRequest(val *InstanceRestartPostRequest) *NullableInstanceRestartPostRequest { + return &NullableInstanceRestartPostRequest{value: val, isSet: true} +} + +func (v NullableInstanceRestartPostRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceRestartPostRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model__ssh_keys__id__delete_200_response.go b/v1/providers/massedcompute/gen/massedcompute/model__ssh_keys__id__delete_200_response.go new file mode 100644 index 0000000..7996a66 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model__ssh_keys__id__delete_200_response.go @@ -0,0 +1,153 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the SshKeysIdDelete200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SshKeysIdDelete200Response{} + +// SshKeysIdDelete200Response struct for SshKeysIdDelete200Response +type SshKeysIdDelete200Response struct { + Result map[string]interface{} `json:"result,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SshKeysIdDelete200Response SshKeysIdDelete200Response + +// NewSshKeysIdDelete200Response instantiates a new SshKeysIdDelete200Response 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 NewSshKeysIdDelete200Response() *SshKeysIdDelete200Response { + this := SshKeysIdDelete200Response{} + return &this +} + +// NewSshKeysIdDelete200ResponseWithDefaults instantiates a new SshKeysIdDelete200Response 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 NewSshKeysIdDelete200ResponseWithDefaults() *SshKeysIdDelete200Response { + this := SshKeysIdDelete200Response{} + return &this +} + +// GetResult returns the Result field value if set, zero value otherwise. +func (o *SshKeysIdDelete200Response) GetResult() map[string]interface{} { + if o == nil || IsNil(o.Result) { + var ret map[string]interface{} + return ret + } + return o.Result +} + +// GetResultOk returns a tuple with the Result field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SshKeysIdDelete200Response) GetResultOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Result) { + return map[string]interface{}{}, false + } + return o.Result, true +} + +// HasResult returns a boolean if a field has been set. +func (o *SshKeysIdDelete200Response) HasResult() bool { + if o != nil && !IsNil(o.Result) { + return true + } + + return false +} + +// SetResult gets a reference to the given map[string]interface{} and assigns it to the Result field. +func (o *SshKeysIdDelete200Response) SetResult(v map[string]interface{}) { + o.Result = v +} + +func (o SshKeysIdDelete200Response) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SshKeysIdDelete200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Result) { + toSerialize["result"] = o.Result + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SshKeysIdDelete200Response) UnmarshalJSON(data []byte) (err error) { + varSshKeysIdDelete200Response := _SshKeysIdDelete200Response{} + + err = json.Unmarshal(data, &varSshKeysIdDelete200Response) + + if err != nil { + return err + } + + *o = SshKeysIdDelete200Response(varSshKeysIdDelete200Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "result") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSshKeysIdDelete200Response struct { + value *SshKeysIdDelete200Response + isSet bool +} + +func (v NullableSshKeysIdDelete200Response) Get() *SshKeysIdDelete200Response { + return v.value +} + +func (v *NullableSshKeysIdDelete200Response) Set(val *SshKeysIdDelete200Response) { + v.value = val + v.isSet = true +} + +func (v NullableSshKeysIdDelete200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableSshKeysIdDelete200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSshKeysIdDelete200Response(val *SshKeysIdDelete200Response) *NullableSshKeysIdDelete200Response { + return &NullableSshKeysIdDelete200Response{value: val, isSet: true} +} + +func (v NullableSshKeysIdDelete200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSshKeysIdDelete200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model__ssh_keys_post_request.go b/v1/providers/massedcompute/gen/massedcompute/model__ssh_keys_post_request.go new file mode 100644 index 0000000..8faa252 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model__ssh_keys_post_request.go @@ -0,0 +1,197 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the SshKeysPostRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SshKeysPostRequest{} + +// SshKeysPostRequest struct for SshKeysPostRequest +type SshKeysPostRequest struct { + // The name of the SSH key + Name string `json:"name"` + // The public key associated with the SSH key + PublicKey string `json:"publicKey"` + AdditionalProperties map[string]interface{} +} + +type _SshKeysPostRequest SshKeysPostRequest + +// NewSshKeysPostRequest instantiates a new SshKeysPostRequest 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 NewSshKeysPostRequest(name string, publicKey string) *SshKeysPostRequest { + this := SshKeysPostRequest{} + this.Name = name + this.PublicKey = publicKey + return &this +} + +// NewSshKeysPostRequestWithDefaults instantiates a new SshKeysPostRequest 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 NewSshKeysPostRequestWithDefaults() *SshKeysPostRequest { + this := SshKeysPostRequest{} + return &this +} + +// GetName returns the Name field value +func (o *SshKeysPostRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SshKeysPostRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SshKeysPostRequest) SetName(v string) { + o.Name = v +} + +// GetPublicKey returns the PublicKey field value +func (o *SshKeysPostRequest) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *SshKeysPostRequest) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *SshKeysPostRequest) SetPublicKey(v string) { + o.PublicKey = v +} + +func (o SshKeysPostRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SshKeysPostRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["publicKey"] = o.PublicKey + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SshKeysPostRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "publicKey", + } + + 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) + } + } + + varSshKeysPostRequest := _SshKeysPostRequest{} + + err = json.Unmarshal(data, &varSshKeysPostRequest) + + if err != nil { + return err + } + + *o = SshKeysPostRequest(varSshKeysPostRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "publicKey") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSshKeysPostRequest struct { + value *SshKeysPostRequest + isSet bool +} + +func (v NullableSshKeysPostRequest) Get() *SshKeysPostRequest { + return v.value +} + +func (v *NullableSshKeysPostRequest) Set(val *SshKeysPostRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSshKeysPostRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSshKeysPostRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSshKeysPostRequest(val *SshKeysPostRequest) *NullableSshKeysPostRequest { + return &NullableSshKeysPostRequest{value: val, isSet: true} +} + +func (v NullableSshKeysPostRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSshKeysPostRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_gpu_inventory_v1.go b/v1/providers/massedcompute/gen/massedcompute/model_gpu_inventory_v1.go new file mode 100644 index 0000000..f321e8e --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_gpu_inventory_v1.go @@ -0,0 +1,153 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the GPUInventoryV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GPUInventoryV1{} + +// GPUInventoryV1 struct for GPUInventoryV1 +type GPUInventoryV1 struct { + GpuInventory *map[string]GPUInventoryV1GpuInventoryValue `json:"gpu_inventory,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GPUInventoryV1 GPUInventoryV1 + +// NewGPUInventoryV1 instantiates a new GPUInventoryV1 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 NewGPUInventoryV1() *GPUInventoryV1 { + this := GPUInventoryV1{} + return &this +} + +// NewGPUInventoryV1WithDefaults instantiates a new GPUInventoryV1 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 NewGPUInventoryV1WithDefaults() *GPUInventoryV1 { + this := GPUInventoryV1{} + return &this +} + +// GetGpuInventory returns the GpuInventory field value if set, zero value otherwise. +func (o *GPUInventoryV1) GetGpuInventory() map[string]GPUInventoryV1GpuInventoryValue { + if o == nil || IsNil(o.GpuInventory) { + var ret map[string]GPUInventoryV1GpuInventoryValue + return ret + } + return *o.GpuInventory +} + +// GetGpuInventoryOk returns a tuple with the GpuInventory field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GPUInventoryV1) GetGpuInventoryOk() (*map[string]GPUInventoryV1GpuInventoryValue, bool) { + if o == nil || IsNil(o.GpuInventory) { + return nil, false + } + return o.GpuInventory, true +} + +// HasGpuInventory returns a boolean if a field has been set. +func (o *GPUInventoryV1) HasGpuInventory() bool { + if o != nil && !IsNil(o.GpuInventory) { + return true + } + + return false +} + +// SetGpuInventory gets a reference to the given map[string]GPUInventoryV1GpuInventoryValue and assigns it to the GpuInventory field. +func (o *GPUInventoryV1) SetGpuInventory(v map[string]GPUInventoryV1GpuInventoryValue) { + o.GpuInventory = &v +} + +func (o GPUInventoryV1) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GPUInventoryV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.GpuInventory) { + toSerialize["gpu_inventory"] = o.GpuInventory + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GPUInventoryV1) UnmarshalJSON(data []byte) (err error) { + varGPUInventoryV1 := _GPUInventoryV1{} + + err = json.Unmarshal(data, &varGPUInventoryV1) + + if err != nil { + return err + } + + *o = GPUInventoryV1(varGPUInventoryV1) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "gpu_inventory") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGPUInventoryV1 struct { + value *GPUInventoryV1 + isSet bool +} + +func (v NullableGPUInventoryV1) Get() *GPUInventoryV1 { + return v.value +} + +func (v *NullableGPUInventoryV1) Set(val *GPUInventoryV1) { + v.value = val + v.isSet = true +} + +func (v NullableGPUInventoryV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGPUInventoryV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGPUInventoryV1(val *GPUInventoryV1) *NullableGPUInventoryV1 { + return &NullableGPUInventoryV1{value: val, isSet: true} +} + +func (v NullableGPUInventoryV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGPUInventoryV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_gpu_inventory_v1_gpu_inventory_value.go b/v1/providers/massedcompute/gen/massedcompute/model_gpu_inventory_v1_gpu_inventory_value.go new file mode 100644 index 0000000..ce89548 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_gpu_inventory_v1_gpu_inventory_value.go @@ -0,0 +1,227 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the GPUInventoryV1GpuInventoryValue type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GPUInventoryV1GpuInventoryValue{} + +// GPUInventoryV1GpuInventoryValue struct for GPUInventoryV1GpuInventoryValue +type GPUInventoryV1GpuInventoryValue struct { + InstanceType *GPUInventoryV1GpuInventoryValueInstanceType `json:"instance_type,omitempty"` + RegionsWithCapacityAvailable []GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner `json:"regions_with_capacity_available,omitempty"` + CapacityAvailable *int32 `json:"capacity_available,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GPUInventoryV1GpuInventoryValue GPUInventoryV1GpuInventoryValue + +// NewGPUInventoryV1GpuInventoryValue instantiates a new GPUInventoryV1GpuInventoryValue 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 NewGPUInventoryV1GpuInventoryValue() *GPUInventoryV1GpuInventoryValue { + this := GPUInventoryV1GpuInventoryValue{} + return &this +} + +// NewGPUInventoryV1GpuInventoryValueWithDefaults instantiates a new GPUInventoryV1GpuInventoryValue 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 NewGPUInventoryV1GpuInventoryValueWithDefaults() *GPUInventoryV1GpuInventoryValue { + this := GPUInventoryV1GpuInventoryValue{} + return &this +} + +// GetInstanceType returns the InstanceType field value if set, zero value otherwise. +func (o *GPUInventoryV1GpuInventoryValue) GetInstanceType() GPUInventoryV1GpuInventoryValueInstanceType { + if o == nil || IsNil(o.InstanceType) { + var ret GPUInventoryV1GpuInventoryValueInstanceType + return ret + } + return *o.InstanceType +} + +// GetInstanceTypeOk returns a tuple with the InstanceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GPUInventoryV1GpuInventoryValue) GetInstanceTypeOk() (*GPUInventoryV1GpuInventoryValueInstanceType, bool) { + if o == nil || IsNil(o.InstanceType) { + return nil, false + } + return o.InstanceType, true +} + +// HasInstanceType returns a boolean if a field has been set. +func (o *GPUInventoryV1GpuInventoryValue) HasInstanceType() bool { + if o != nil && !IsNil(o.InstanceType) { + return true + } + + return false +} + +// SetInstanceType gets a reference to the given GPUInventoryV1GpuInventoryValueInstanceType and assigns it to the InstanceType field. +func (o *GPUInventoryV1GpuInventoryValue) SetInstanceType(v GPUInventoryV1GpuInventoryValueInstanceType) { + o.InstanceType = &v +} + +// GetRegionsWithCapacityAvailable returns the RegionsWithCapacityAvailable field value if set, zero value otherwise. +func (o *GPUInventoryV1GpuInventoryValue) GetRegionsWithCapacityAvailable() []GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner { + if o == nil || IsNil(o.RegionsWithCapacityAvailable) { + var ret []GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner + return ret + } + return o.RegionsWithCapacityAvailable +} + +// GetRegionsWithCapacityAvailableOk returns a tuple with the RegionsWithCapacityAvailable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GPUInventoryV1GpuInventoryValue) GetRegionsWithCapacityAvailableOk() ([]GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner, bool) { + if o == nil || IsNil(o.RegionsWithCapacityAvailable) { + return nil, false + } + return o.RegionsWithCapacityAvailable, true +} + +// HasRegionsWithCapacityAvailable returns a boolean if a field has been set. +func (o *GPUInventoryV1GpuInventoryValue) HasRegionsWithCapacityAvailable() bool { + if o != nil && !IsNil(o.RegionsWithCapacityAvailable) { + return true + } + + return false +} + +// SetRegionsWithCapacityAvailable gets a reference to the given []GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner and assigns it to the RegionsWithCapacityAvailable field. +func (o *GPUInventoryV1GpuInventoryValue) SetRegionsWithCapacityAvailable(v []GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) { + o.RegionsWithCapacityAvailable = v +} + +// GetCapacityAvailable returns the CapacityAvailable field value if set, zero value otherwise. +func (o *GPUInventoryV1GpuInventoryValue) GetCapacityAvailable() int32 { + if o == nil || IsNil(o.CapacityAvailable) { + var ret int32 + return ret + } + return *o.CapacityAvailable +} + +// GetCapacityAvailableOk returns a tuple with the CapacityAvailable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GPUInventoryV1GpuInventoryValue) GetCapacityAvailableOk() (*int32, bool) { + if o == nil || IsNil(o.CapacityAvailable) { + return nil, false + } + return o.CapacityAvailable, true +} + +// HasCapacityAvailable returns a boolean if a field has been set. +func (o *GPUInventoryV1GpuInventoryValue) HasCapacityAvailable() bool { + if o != nil && !IsNil(o.CapacityAvailable) { + return true + } + + return false +} + +// SetCapacityAvailable gets a reference to the given int32 and assigns it to the CapacityAvailable field. +func (o *GPUInventoryV1GpuInventoryValue) SetCapacityAvailable(v int32) { + o.CapacityAvailable = &v +} + +func (o GPUInventoryV1GpuInventoryValue) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GPUInventoryV1GpuInventoryValue) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.InstanceType) { + toSerialize["instance_type"] = o.InstanceType + } + if !IsNil(o.RegionsWithCapacityAvailable) { + toSerialize["regions_with_capacity_available"] = o.RegionsWithCapacityAvailable + } + if !IsNil(o.CapacityAvailable) { + toSerialize["capacity_available"] = o.CapacityAvailable + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GPUInventoryV1GpuInventoryValue) UnmarshalJSON(data []byte) (err error) { + varGPUInventoryV1GpuInventoryValue := _GPUInventoryV1GpuInventoryValue{} + + err = json.Unmarshal(data, &varGPUInventoryV1GpuInventoryValue) + + if err != nil { + return err + } + + *o = GPUInventoryV1GpuInventoryValue(varGPUInventoryV1GpuInventoryValue) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instance_type") + delete(additionalProperties, "regions_with_capacity_available") + delete(additionalProperties, "capacity_available") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGPUInventoryV1GpuInventoryValue struct { + value *GPUInventoryV1GpuInventoryValue + isSet bool +} + +func (v NullableGPUInventoryV1GpuInventoryValue) Get() *GPUInventoryV1GpuInventoryValue { + return v.value +} + +func (v *NullableGPUInventoryV1GpuInventoryValue) Set(val *GPUInventoryV1GpuInventoryValue) { + v.value = val + v.isSet = true +} + +func (v NullableGPUInventoryV1GpuInventoryValue) IsSet() bool { + return v.isSet +} + +func (v *NullableGPUInventoryV1GpuInventoryValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGPUInventoryV1GpuInventoryValue(val *GPUInventoryV1GpuInventoryValue) *NullableGPUInventoryV1GpuInventoryValue { + return &NullableGPUInventoryV1GpuInventoryValue{value: val, isSet: true} +} + +func (v NullableGPUInventoryV1GpuInventoryValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGPUInventoryV1GpuInventoryValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_gpu_inventory_v1_gpu_inventory_value_instance_type.go b/v1/providers/massedcompute/gen/massedcompute/model_gpu_inventory_v1_gpu_inventory_value_instance_type.go new file mode 100644 index 0000000..fb593e6 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_gpu_inventory_v1_gpu_inventory_value_instance_type.go @@ -0,0 +1,264 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the GPUInventoryV1GpuInventoryValueInstanceType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GPUInventoryV1GpuInventoryValueInstanceType{} + +// GPUInventoryV1GpuInventoryValueInstanceType struct for GPUInventoryV1GpuInventoryValueInstanceType +type GPUInventoryV1GpuInventoryValueInstanceType struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + PriceCentsPerHour *int32 `json:"price_cents_per_hour,omitempty"` + Specs *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs `json:"specs,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GPUInventoryV1GpuInventoryValueInstanceType GPUInventoryV1GpuInventoryValueInstanceType + +// NewGPUInventoryV1GpuInventoryValueInstanceType instantiates a new GPUInventoryV1GpuInventoryValueInstanceType 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 NewGPUInventoryV1GpuInventoryValueInstanceType() *GPUInventoryV1GpuInventoryValueInstanceType { + this := GPUInventoryV1GpuInventoryValueInstanceType{} + return &this +} + +// NewGPUInventoryV1GpuInventoryValueInstanceTypeWithDefaults instantiates a new GPUInventoryV1GpuInventoryValueInstanceType 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 NewGPUInventoryV1GpuInventoryValueInstanceTypeWithDefaults() *GPUInventoryV1GpuInventoryValueInstanceType { + this := GPUInventoryV1GpuInventoryValueInstanceType{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GPUInventoryV1GpuInventoryValueInstanceType) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GPUInventoryV1GpuInventoryValueInstanceType) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *GPUInventoryV1GpuInventoryValueInstanceType) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *GPUInventoryV1GpuInventoryValueInstanceType) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *GPUInventoryV1GpuInventoryValueInstanceType) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GPUInventoryV1GpuInventoryValueInstanceType) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *GPUInventoryV1GpuInventoryValueInstanceType) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *GPUInventoryV1GpuInventoryValueInstanceType) SetDescription(v string) { + o.Description = &v +} + +// GetPriceCentsPerHour returns the PriceCentsPerHour field value if set, zero value otherwise. +func (o *GPUInventoryV1GpuInventoryValueInstanceType) GetPriceCentsPerHour() int32 { + if o == nil || IsNil(o.PriceCentsPerHour) { + var ret int32 + return ret + } + return *o.PriceCentsPerHour +} + +// GetPriceCentsPerHourOk returns a tuple with the PriceCentsPerHour field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GPUInventoryV1GpuInventoryValueInstanceType) GetPriceCentsPerHourOk() (*int32, bool) { + if o == nil || IsNil(o.PriceCentsPerHour) { + return nil, false + } + return o.PriceCentsPerHour, true +} + +// HasPriceCentsPerHour returns a boolean if a field has been set. +func (o *GPUInventoryV1GpuInventoryValueInstanceType) HasPriceCentsPerHour() bool { + if o != nil && !IsNil(o.PriceCentsPerHour) { + return true + } + + return false +} + +// SetPriceCentsPerHour gets a reference to the given int32 and assigns it to the PriceCentsPerHour field. +func (o *GPUInventoryV1GpuInventoryValueInstanceType) SetPriceCentsPerHour(v int32) { + o.PriceCentsPerHour = &v +} + +// GetSpecs returns the Specs field value if set, zero value otherwise. +func (o *GPUInventoryV1GpuInventoryValueInstanceType) GetSpecs() GPUInventoryV1GpuInventoryValueInstanceTypeSpecs { + if o == nil || IsNil(o.Specs) { + var ret GPUInventoryV1GpuInventoryValueInstanceTypeSpecs + return ret + } + return *o.Specs +} + +// GetSpecsOk returns a tuple with the Specs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GPUInventoryV1GpuInventoryValueInstanceType) GetSpecsOk() (*GPUInventoryV1GpuInventoryValueInstanceTypeSpecs, bool) { + if o == nil || IsNil(o.Specs) { + return nil, false + } + return o.Specs, true +} + +// HasSpecs returns a boolean if a field has been set. +func (o *GPUInventoryV1GpuInventoryValueInstanceType) HasSpecs() bool { + if o != nil && !IsNil(o.Specs) { + return true + } + + return false +} + +// SetSpecs gets a reference to the given GPUInventoryV1GpuInventoryValueInstanceTypeSpecs and assigns it to the Specs field. +func (o *GPUInventoryV1GpuInventoryValueInstanceType) SetSpecs(v GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) { + o.Specs = &v +} + +func (o GPUInventoryV1GpuInventoryValueInstanceType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GPUInventoryV1GpuInventoryValueInstanceType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.PriceCentsPerHour) { + toSerialize["price_cents_per_hour"] = o.PriceCentsPerHour + } + if !IsNil(o.Specs) { + toSerialize["specs"] = o.Specs + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GPUInventoryV1GpuInventoryValueInstanceType) UnmarshalJSON(data []byte) (err error) { + varGPUInventoryV1GpuInventoryValueInstanceType := _GPUInventoryV1GpuInventoryValueInstanceType{} + + err = json.Unmarshal(data, &varGPUInventoryV1GpuInventoryValueInstanceType) + + if err != nil { + return err + } + + *o = GPUInventoryV1GpuInventoryValueInstanceType(varGPUInventoryV1GpuInventoryValueInstanceType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "price_cents_per_hour") + delete(additionalProperties, "specs") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGPUInventoryV1GpuInventoryValueInstanceType struct { + value *GPUInventoryV1GpuInventoryValueInstanceType + isSet bool +} + +func (v NullableGPUInventoryV1GpuInventoryValueInstanceType) Get() *GPUInventoryV1GpuInventoryValueInstanceType { + return v.value +} + +func (v *NullableGPUInventoryV1GpuInventoryValueInstanceType) Set(val *GPUInventoryV1GpuInventoryValueInstanceType) { + v.value = val + v.isSet = true +} + +func (v NullableGPUInventoryV1GpuInventoryValueInstanceType) IsSet() bool { + return v.isSet +} + +func (v *NullableGPUInventoryV1GpuInventoryValueInstanceType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGPUInventoryV1GpuInventoryValueInstanceType(val *GPUInventoryV1GpuInventoryValueInstanceType) *NullableGPUInventoryV1GpuInventoryValueInstanceType { + return &NullableGPUInventoryV1GpuInventoryValueInstanceType{value: val, isSet: true} +} + +func (v NullableGPUInventoryV1GpuInventoryValueInstanceType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGPUInventoryV1GpuInventoryValueInstanceType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_gpu_inventory_v1_gpu_inventory_value_instance_type_specs.go b/v1/providers/massedcompute/gen/massedcompute/model_gpu_inventory_v1_gpu_inventory_value_instance_type_specs.go new file mode 100644 index 0000000..00fca6b --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_gpu_inventory_v1_gpu_inventory_value_instance_type_specs.go @@ -0,0 +1,227 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the GPUInventoryV1GpuInventoryValueInstanceTypeSpecs type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GPUInventoryV1GpuInventoryValueInstanceTypeSpecs{} + +// GPUInventoryV1GpuInventoryValueInstanceTypeSpecs struct for GPUInventoryV1GpuInventoryValueInstanceTypeSpecs +type GPUInventoryV1GpuInventoryValueInstanceTypeSpecs struct { + VcpuCount *int32 `json:"vcpu_count,omitempty"` + MemoryGib *int32 `json:"memory_gib,omitempty"` + StorageGb *int32 `json:"storage_gb,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GPUInventoryV1GpuInventoryValueInstanceTypeSpecs GPUInventoryV1GpuInventoryValueInstanceTypeSpecs + +// NewGPUInventoryV1GpuInventoryValueInstanceTypeSpecs instantiates a new GPUInventoryV1GpuInventoryValueInstanceTypeSpecs 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 NewGPUInventoryV1GpuInventoryValueInstanceTypeSpecs() *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs { + this := GPUInventoryV1GpuInventoryValueInstanceTypeSpecs{} + return &this +} + +// NewGPUInventoryV1GpuInventoryValueInstanceTypeSpecsWithDefaults instantiates a new GPUInventoryV1GpuInventoryValueInstanceTypeSpecs 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 NewGPUInventoryV1GpuInventoryValueInstanceTypeSpecsWithDefaults() *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs { + this := GPUInventoryV1GpuInventoryValueInstanceTypeSpecs{} + return &this +} + +// GetVcpuCount returns the VcpuCount field value if set, zero value otherwise. +func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) GetVcpuCount() int32 { + if o == nil || IsNil(o.VcpuCount) { + var ret int32 + return ret + } + return *o.VcpuCount +} + +// GetVcpuCountOk returns a tuple with the VcpuCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) GetVcpuCountOk() (*int32, bool) { + if o == nil || IsNil(o.VcpuCount) { + return nil, false + } + return o.VcpuCount, true +} + +// HasVcpuCount returns a boolean if a field has been set. +func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) HasVcpuCount() bool { + if o != nil && !IsNil(o.VcpuCount) { + return true + } + + return false +} + +// SetVcpuCount gets a reference to the given int32 and assigns it to the VcpuCount field. +func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) SetVcpuCount(v int32) { + o.VcpuCount = &v +} + +// GetMemoryGib returns the MemoryGib field value if set, zero value otherwise. +func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) GetMemoryGib() int32 { + if o == nil || IsNil(o.MemoryGib) { + var ret int32 + return ret + } + return *o.MemoryGib +} + +// GetMemoryGibOk returns a tuple with the MemoryGib field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) GetMemoryGibOk() (*int32, bool) { + if o == nil || IsNil(o.MemoryGib) { + return nil, false + } + return o.MemoryGib, true +} + +// HasMemoryGib returns a boolean if a field has been set. +func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) HasMemoryGib() bool { + if o != nil && !IsNil(o.MemoryGib) { + return true + } + + return false +} + +// SetMemoryGib gets a reference to the given int32 and assigns it to the MemoryGib field. +func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) SetMemoryGib(v int32) { + o.MemoryGib = &v +} + +// GetStorageGb returns the StorageGb field value if set, zero value otherwise. +func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) GetStorageGb() int32 { + if o == nil || IsNil(o.StorageGb) { + var ret int32 + return ret + } + return *o.StorageGb +} + +// GetStorageGbOk returns a tuple with the StorageGb field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) GetStorageGbOk() (*int32, bool) { + if o == nil || IsNil(o.StorageGb) { + return nil, false + } + return o.StorageGb, true +} + +// HasStorageGb returns a boolean if a field has been set. +func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) HasStorageGb() bool { + if o != nil && !IsNil(o.StorageGb) { + return true + } + + return false +} + +// SetStorageGb gets a reference to the given int32 and assigns it to the StorageGb field. +func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) SetStorageGb(v int32) { + o.StorageGb = &v +} + +func (o GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.VcpuCount) { + toSerialize["vcpu_count"] = o.VcpuCount + } + if !IsNil(o.MemoryGib) { + toSerialize["memory_gib"] = o.MemoryGib + } + if !IsNil(o.StorageGb) { + toSerialize["storage_gb"] = o.StorageGb + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) UnmarshalJSON(data []byte) (err error) { + varGPUInventoryV1GpuInventoryValueInstanceTypeSpecs := _GPUInventoryV1GpuInventoryValueInstanceTypeSpecs{} + + err = json.Unmarshal(data, &varGPUInventoryV1GpuInventoryValueInstanceTypeSpecs) + + if err != nil { + return err + } + + *o = GPUInventoryV1GpuInventoryValueInstanceTypeSpecs(varGPUInventoryV1GpuInventoryValueInstanceTypeSpecs) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "vcpu_count") + delete(additionalProperties, "memory_gib") + delete(additionalProperties, "storage_gb") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGPUInventoryV1GpuInventoryValueInstanceTypeSpecs struct { + value *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs + isSet bool +} + +func (v NullableGPUInventoryV1GpuInventoryValueInstanceTypeSpecs) Get() *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs { + return v.value +} + +func (v *NullableGPUInventoryV1GpuInventoryValueInstanceTypeSpecs) Set(val *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) { + v.value = val + v.isSet = true +} + +func (v NullableGPUInventoryV1GpuInventoryValueInstanceTypeSpecs) IsSet() bool { + return v.isSet +} + +func (v *NullableGPUInventoryV1GpuInventoryValueInstanceTypeSpecs) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGPUInventoryV1GpuInventoryValueInstanceTypeSpecs(val *GPUInventoryV1GpuInventoryValueInstanceTypeSpecs) *NullableGPUInventoryV1GpuInventoryValueInstanceTypeSpecs { + return &NullableGPUInventoryV1GpuInventoryValueInstanceTypeSpecs{value: val, isSet: true} +} + +func (v NullableGPUInventoryV1GpuInventoryValueInstanceTypeSpecs) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGPUInventoryV1GpuInventoryValueInstanceTypeSpecs) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_gpu_inventory_v1_gpu_inventory_value_regions_with_capacity_available_inner.go b/v1/providers/massedcompute/gen/massedcompute/model_gpu_inventory_v1_gpu_inventory_value_regions_with_capacity_available_inner.go new file mode 100644 index 0000000..c5eba5f --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_gpu_inventory_v1_gpu_inventory_value_regions_with_capacity_available_inner.go @@ -0,0 +1,190 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner{} + +// GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner struct for GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner +type GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner + +// NewGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner instantiates a new GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner 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 NewGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner() *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner { + this := GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner{} + return &this +} + +// NewGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInnerWithDefaults instantiates a new GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner 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 NewGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInnerWithDefaults() *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner { + this := GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) SetDescription(v string) { + o.Description = &v +} + +func (o GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) UnmarshalJSON(data []byte) (err error) { + varGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner := _GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner{} + + err = json.Unmarshal(data, &varGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) + + if err != nil { + return err + } + + *o = GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner(varGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner struct { + value *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner + isSet bool +} + +func (v NullableGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) Get() *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner { + return v.value +} + +func (v *NullableGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) Set(val *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) { + v.value = val + v.isSet = true +} + +func (v NullableGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) IsSet() bool { + return v.isSet +} + +func (v *NullableGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner(val *GPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) *NullableGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner { + return &NullableGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner{value: val, isSet: true} +} + +func (v NullableGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGPUInventoryV1GpuInventoryValueRegionsWithCapacityAvailableInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_images_v1.go b/v1/providers/massedcompute/gen/massedcompute/model_images_v1.go new file mode 100644 index 0000000..506ac1f --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_images_v1.go @@ -0,0 +1,153 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the ImagesV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImagesV1{} + +// ImagesV1 struct for ImagesV1 +type ImagesV1 struct { + Images []ImagesV1ImagesInner `json:"images,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ImagesV1 ImagesV1 + +// NewImagesV1 instantiates a new ImagesV1 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 NewImagesV1() *ImagesV1 { + this := ImagesV1{} + return &this +} + +// NewImagesV1WithDefaults instantiates a new ImagesV1 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 NewImagesV1WithDefaults() *ImagesV1 { + this := ImagesV1{} + return &this +} + +// GetImages returns the Images field value if set, zero value otherwise. +func (o *ImagesV1) GetImages() []ImagesV1ImagesInner { + if o == nil || IsNil(o.Images) { + var ret []ImagesV1ImagesInner + return ret + } + return o.Images +} + +// GetImagesOk returns a tuple with the Images field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImagesV1) GetImagesOk() ([]ImagesV1ImagesInner, bool) { + if o == nil || IsNil(o.Images) { + return nil, false + } + return o.Images, true +} + +// HasImages returns a boolean if a field has been set. +func (o *ImagesV1) HasImages() bool { + if o != nil && !IsNil(o.Images) { + return true + } + + return false +} + +// SetImages gets a reference to the given []ImagesV1ImagesInner and assigns it to the Images field. +func (o *ImagesV1) SetImages(v []ImagesV1ImagesInner) { + o.Images = v +} + +func (o ImagesV1) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImagesV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Images) { + toSerialize["images"] = o.Images + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ImagesV1) UnmarshalJSON(data []byte) (err error) { + varImagesV1 := _ImagesV1{} + + err = json.Unmarshal(data, &varImagesV1) + + if err != nil { + return err + } + + *o = ImagesV1(varImagesV1) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "images") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableImagesV1 struct { + value *ImagesV1 + isSet bool +} + +func (v NullableImagesV1) Get() *ImagesV1 { + return v.value +} + +func (v *NullableImagesV1) Set(val *ImagesV1) { + v.value = val + v.isSet = true +} + +func (v NullableImagesV1) IsSet() bool { + return v.isSet +} + +func (v *NullableImagesV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImagesV1(val *ImagesV1) *NullableImagesV1 { + return &NullableImagesV1{value: val, isSet: true} +} + +func (v NullableImagesV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImagesV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_images_v1_images_inner.go b/v1/providers/massedcompute/gen/massedcompute/model_images_v1_images_inner.go new file mode 100644 index 0000000..635c1df --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_images_v1_images_inner.go @@ -0,0 +1,227 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the ImagesV1ImagesInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImagesV1ImagesInner{} + +// ImagesV1ImagesInner struct for ImagesV1ImagesInner +type ImagesV1ImagesInner struct { + VmImageId *int32 `json:"vm_image_id,omitempty"` + VmImageName *string `json:"vm_image_name,omitempty"` + VmImageDescription *string `json:"vm_image_description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ImagesV1ImagesInner ImagesV1ImagesInner + +// NewImagesV1ImagesInner instantiates a new ImagesV1ImagesInner 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 NewImagesV1ImagesInner() *ImagesV1ImagesInner { + this := ImagesV1ImagesInner{} + return &this +} + +// NewImagesV1ImagesInnerWithDefaults instantiates a new ImagesV1ImagesInner 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 NewImagesV1ImagesInnerWithDefaults() *ImagesV1ImagesInner { + this := ImagesV1ImagesInner{} + return &this +} + +// GetVmImageId returns the VmImageId field value if set, zero value otherwise. +func (o *ImagesV1ImagesInner) GetVmImageId() int32 { + if o == nil || IsNil(o.VmImageId) { + var ret int32 + return ret + } + return *o.VmImageId +} + +// GetVmImageIdOk returns a tuple with the VmImageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImagesV1ImagesInner) GetVmImageIdOk() (*int32, bool) { + if o == nil || IsNil(o.VmImageId) { + return nil, false + } + return o.VmImageId, true +} + +// HasVmImageId returns a boolean if a field has been set. +func (o *ImagesV1ImagesInner) HasVmImageId() bool { + if o != nil && !IsNil(o.VmImageId) { + return true + } + + return false +} + +// SetVmImageId gets a reference to the given int32 and assigns it to the VmImageId field. +func (o *ImagesV1ImagesInner) SetVmImageId(v int32) { + o.VmImageId = &v +} + +// GetVmImageName returns the VmImageName field value if set, zero value otherwise. +func (o *ImagesV1ImagesInner) GetVmImageName() string { + if o == nil || IsNil(o.VmImageName) { + var ret string + return ret + } + return *o.VmImageName +} + +// GetVmImageNameOk returns a tuple with the VmImageName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImagesV1ImagesInner) GetVmImageNameOk() (*string, bool) { + if o == nil || IsNil(o.VmImageName) { + return nil, false + } + return o.VmImageName, true +} + +// HasVmImageName returns a boolean if a field has been set. +func (o *ImagesV1ImagesInner) HasVmImageName() bool { + if o != nil && !IsNil(o.VmImageName) { + return true + } + + return false +} + +// SetVmImageName gets a reference to the given string and assigns it to the VmImageName field. +func (o *ImagesV1ImagesInner) SetVmImageName(v string) { + o.VmImageName = &v +} + +// GetVmImageDescription returns the VmImageDescription field value if set, zero value otherwise. +func (o *ImagesV1ImagesInner) GetVmImageDescription() string { + if o == nil || IsNil(o.VmImageDescription) { + var ret string + return ret + } + return *o.VmImageDescription +} + +// GetVmImageDescriptionOk returns a tuple with the VmImageDescription field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImagesV1ImagesInner) GetVmImageDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.VmImageDescription) { + return nil, false + } + return o.VmImageDescription, true +} + +// HasVmImageDescription returns a boolean if a field has been set. +func (o *ImagesV1ImagesInner) HasVmImageDescription() bool { + if o != nil && !IsNil(o.VmImageDescription) { + return true + } + + return false +} + +// SetVmImageDescription gets a reference to the given string and assigns it to the VmImageDescription field. +func (o *ImagesV1ImagesInner) SetVmImageDescription(v string) { + o.VmImageDescription = &v +} + +func (o ImagesV1ImagesInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImagesV1ImagesInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.VmImageId) { + toSerialize["vm_image_id"] = o.VmImageId + } + if !IsNil(o.VmImageName) { + toSerialize["vm_image_name"] = o.VmImageName + } + if !IsNil(o.VmImageDescription) { + toSerialize["vm_image_description"] = o.VmImageDescription + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ImagesV1ImagesInner) UnmarshalJSON(data []byte) (err error) { + varImagesV1ImagesInner := _ImagesV1ImagesInner{} + + err = json.Unmarshal(data, &varImagesV1ImagesInner) + + if err != nil { + return err + } + + *o = ImagesV1ImagesInner(varImagesV1ImagesInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "vm_image_id") + delete(additionalProperties, "vm_image_name") + delete(additionalProperties, "vm_image_description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableImagesV1ImagesInner struct { + value *ImagesV1ImagesInner + isSet bool +} + +func (v NullableImagesV1ImagesInner) Get() *ImagesV1ImagesInner { + return v.value +} + +func (v *NullableImagesV1ImagesInner) Set(val *ImagesV1ImagesInner) { + v.value = val + v.isSet = true +} + +func (v NullableImagesV1ImagesInner) IsSet() bool { + return v.isSet +} + +func (v *NullableImagesV1ImagesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImagesV1ImagesInner(val *ImagesV1ImagesInner) *NullableImagesV1ImagesInner { + return &NullableImagesV1ImagesInner{value: val, isSet: true} +} + +func (v NullableImagesV1ImagesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImagesV1ImagesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_postssh_key.go b/v1/providers/massedcompute/gen/massedcompute/model_postssh_key.go new file mode 100644 index 0000000..85d73fe --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_postssh_key.go @@ -0,0 +1,153 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the POSTSSHKey type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &POSTSSHKey{} + +// POSTSSHKey struct for POSTSSHKey +type POSTSSHKey struct { + SshKey *POSTSSHKeySshKey `json:"sshKey,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _POSTSSHKey POSTSSHKey + +// NewPOSTSSHKey instantiates a new POSTSSHKey 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 NewPOSTSSHKey() *POSTSSHKey { + this := POSTSSHKey{} + return &this +} + +// NewPOSTSSHKeyWithDefaults instantiates a new POSTSSHKey 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 NewPOSTSSHKeyWithDefaults() *POSTSSHKey { + this := POSTSSHKey{} + return &this +} + +// GetSshKey returns the SshKey field value if set, zero value otherwise. +func (o *POSTSSHKey) GetSshKey() POSTSSHKeySshKey { + if o == nil || IsNil(o.SshKey) { + var ret POSTSSHKeySshKey + return ret + } + return *o.SshKey +} + +// GetSshKeyOk returns a tuple with the SshKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *POSTSSHKey) GetSshKeyOk() (*POSTSSHKeySshKey, bool) { + if o == nil || IsNil(o.SshKey) { + return nil, false + } + return o.SshKey, true +} + +// HasSshKey returns a boolean if a field has been set. +func (o *POSTSSHKey) HasSshKey() bool { + if o != nil && !IsNil(o.SshKey) { + return true + } + + return false +} + +// SetSshKey gets a reference to the given POSTSSHKeySshKey and assigns it to the SshKey field. +func (o *POSTSSHKey) SetSshKey(v POSTSSHKeySshKey) { + o.SshKey = &v +} + +func (o POSTSSHKey) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o POSTSSHKey) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.SshKey) { + toSerialize["sshKey"] = o.SshKey + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *POSTSSHKey) UnmarshalJSON(data []byte) (err error) { + varPOSTSSHKey := _POSTSSHKey{} + + err = json.Unmarshal(data, &varPOSTSSHKey) + + if err != nil { + return err + } + + *o = POSTSSHKey(varPOSTSSHKey) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "sshKey") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePOSTSSHKey struct { + value *POSTSSHKey + isSet bool +} + +func (v NullablePOSTSSHKey) Get() *POSTSSHKey { + return v.value +} + +func (v *NullablePOSTSSHKey) Set(val *POSTSSHKey) { + v.value = val + v.isSet = true +} + +func (v NullablePOSTSSHKey) IsSet() bool { + return v.isSet +} + +func (v *NullablePOSTSSHKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePOSTSSHKey(val *POSTSSHKey) *NullablePOSTSSHKey { + return &NullablePOSTSSHKey{value: val, isSet: true} +} + +func (v NullablePOSTSSHKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePOSTSSHKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_postssh_key_ssh_key.go b/v1/providers/massedcompute/gen/massedcompute/model_postssh_key_ssh_key.go new file mode 100644 index 0000000..9bb7e81 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_postssh_key_ssh_key.go @@ -0,0 +1,192 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the POSTSSHKeySshKey type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &POSTSSHKeySshKey{} + +// POSTSSHKeySshKey struct for POSTSSHKeySshKey +type POSTSSHKeySshKey struct { + // The unique identifier for the SSH key + Id *string `json:"id,omitempty"` + // The name of the SSH key + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _POSTSSHKeySshKey POSTSSHKeySshKey + +// NewPOSTSSHKeySshKey instantiates a new POSTSSHKeySshKey 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 NewPOSTSSHKeySshKey() *POSTSSHKeySshKey { + this := POSTSSHKeySshKey{} + return &this +} + +// NewPOSTSSHKeySshKeyWithDefaults instantiates a new POSTSSHKeySshKey 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 NewPOSTSSHKeySshKeyWithDefaults() *POSTSSHKeySshKey { + this := POSTSSHKeySshKey{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *POSTSSHKeySshKey) 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 *POSTSSHKeySshKey) 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 *POSTSSHKeySshKey) 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 *POSTSSHKeySshKey) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *POSTSSHKeySshKey) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *POSTSSHKeySshKey) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *POSTSSHKeySshKey) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *POSTSSHKeySshKey) SetName(v string) { + o.Name = &v +} + +func (o POSTSSHKeySshKey) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o POSTSSHKeySshKey) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *POSTSSHKeySshKey) UnmarshalJSON(data []byte) (err error) { + varPOSTSSHKeySshKey := _POSTSSHKeySshKey{} + + err = json.Unmarshal(data, &varPOSTSSHKeySshKey) + + if err != nil { + return err + } + + *o = POSTSSHKeySshKey(varPOSTSSHKeySshKey) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePOSTSSHKeySshKey struct { + value *POSTSSHKeySshKey + isSet bool +} + +func (v NullablePOSTSSHKeySshKey) Get() *POSTSSHKeySshKey { + return v.value +} + +func (v *NullablePOSTSSHKeySshKey) Set(val *POSTSSHKeySshKey) { + v.value = val + v.isSet = true +} + +func (v NullablePOSTSSHKeySshKey) IsSet() bool { + return v.isSet +} + +func (v *NullablePOSTSSHKeySshKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePOSTSSHKeySshKey(val *POSTSSHKeySshKey) *NullablePOSTSSHKeySshKey { + return &NullablePOSTSSHKeySshKey{value: val, isSet: true} +} + +func (v NullablePOSTSSHKeySshKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePOSTSSHKeySshKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_restart_instance_v1.go b/v1/providers/massedcompute/gen/massedcompute/model_restart_instance_v1.go new file mode 100644 index 0000000..7fe173c --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_restart_instance_v1.go @@ -0,0 +1,153 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the RestartInstanceV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RestartInstanceV1{} + +// RestartInstanceV1 struct for RestartInstanceV1 +type RestartInstanceV1 struct { + Response []RestartInstanceV1ResponseInner `json:"response,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RestartInstanceV1 RestartInstanceV1 + +// NewRestartInstanceV1 instantiates a new RestartInstanceV1 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 NewRestartInstanceV1() *RestartInstanceV1 { + this := RestartInstanceV1{} + return &this +} + +// NewRestartInstanceV1WithDefaults instantiates a new RestartInstanceV1 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 NewRestartInstanceV1WithDefaults() *RestartInstanceV1 { + this := RestartInstanceV1{} + return &this +} + +// GetResponse returns the Response field value if set, zero value otherwise. +func (o *RestartInstanceV1) GetResponse() []RestartInstanceV1ResponseInner { + if o == nil || IsNil(o.Response) { + var ret []RestartInstanceV1ResponseInner + return ret + } + return o.Response +} + +// GetResponseOk returns a tuple with the Response field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestartInstanceV1) GetResponseOk() ([]RestartInstanceV1ResponseInner, bool) { + if o == nil || IsNil(o.Response) { + return nil, false + } + return o.Response, true +} + +// HasResponse returns a boolean if a field has been set. +func (o *RestartInstanceV1) HasResponse() bool { + if o != nil && !IsNil(o.Response) { + return true + } + + return false +} + +// SetResponse gets a reference to the given []RestartInstanceV1ResponseInner and assigns it to the Response field. +func (o *RestartInstanceV1) SetResponse(v []RestartInstanceV1ResponseInner) { + o.Response = v +} + +func (o RestartInstanceV1) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RestartInstanceV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Response) { + toSerialize["response"] = o.Response + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RestartInstanceV1) UnmarshalJSON(data []byte) (err error) { + varRestartInstanceV1 := _RestartInstanceV1{} + + err = json.Unmarshal(data, &varRestartInstanceV1) + + if err != nil { + return err + } + + *o = RestartInstanceV1(varRestartInstanceV1) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "response") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRestartInstanceV1 struct { + value *RestartInstanceV1 + isSet bool +} + +func (v NullableRestartInstanceV1) Get() *RestartInstanceV1 { + return v.value +} + +func (v *NullableRestartInstanceV1) Set(val *RestartInstanceV1) { + v.value = val + v.isSet = true +} + +func (v NullableRestartInstanceV1) IsSet() bool { + return v.isSet +} + +func (v *NullableRestartInstanceV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestartInstanceV1(val *RestartInstanceV1) *NullableRestartInstanceV1 { + return &NullableRestartInstanceV1{value: val, isSet: true} +} + +func (v NullableRestartInstanceV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestartInstanceV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_restart_instance_v1_response_inner.go b/v1/providers/massedcompute/gen/massedcompute/model_restart_instance_v1_response_inner.go new file mode 100644 index 0000000..ebc6358 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_restart_instance_v1_response_inner.go @@ -0,0 +1,486 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the RestartInstanceV1ResponseInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RestartInstanceV1ResponseInner{} + +// RestartInstanceV1ResponseInner struct for RestartInstanceV1ResponseInner +type RestartInstanceV1ResponseInner struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Ip *string `json:"ip,omitempty"` + Status *string `json:"status,omitempty"` + SshKeyNames []string `json:"ssh_key_names,omitempty"` + FileSystemNames []string `json:"file_system_names,omitempty"` + Region *RestartInstanceV1ResponseInnerRegion `json:"region,omitempty"` + InstanceType *RestartInstanceV1ResponseInnerInstanceType `json:"instance_type,omitempty"` + JupyterToken *string `json:"jupyter_token,omitempty"` + JupyterUrl *string `json:"jupyter_url,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RestartInstanceV1ResponseInner RestartInstanceV1ResponseInner + +// NewRestartInstanceV1ResponseInner instantiates a new RestartInstanceV1ResponseInner 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 NewRestartInstanceV1ResponseInner() *RestartInstanceV1ResponseInner { + this := RestartInstanceV1ResponseInner{} + return &this +} + +// NewRestartInstanceV1ResponseInnerWithDefaults instantiates a new RestartInstanceV1ResponseInner 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 NewRestartInstanceV1ResponseInnerWithDefaults() *RestartInstanceV1ResponseInner { + this := RestartInstanceV1ResponseInner{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *RestartInstanceV1ResponseInner) 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 *RestartInstanceV1ResponseInner) 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 *RestartInstanceV1ResponseInner) 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 *RestartInstanceV1ResponseInner) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *RestartInstanceV1ResponseInner) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestartInstanceV1ResponseInner) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *RestartInstanceV1ResponseInner) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *RestartInstanceV1ResponseInner) SetName(v string) { + o.Name = &v +} + +// GetIp returns the Ip field value if set, zero value otherwise. +func (o *RestartInstanceV1ResponseInner) GetIp() string { + if o == nil || IsNil(o.Ip) { + var ret string + return ret + } + return *o.Ip +} + +// GetIpOk returns a tuple with the Ip field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestartInstanceV1ResponseInner) GetIpOk() (*string, bool) { + if o == nil || IsNil(o.Ip) { + return nil, false + } + return o.Ip, true +} + +// HasIp returns a boolean if a field has been set. +func (o *RestartInstanceV1ResponseInner) HasIp() bool { + if o != nil && !IsNil(o.Ip) { + return true + } + + return false +} + +// SetIp gets a reference to the given string and assigns it to the Ip field. +func (o *RestartInstanceV1ResponseInner) SetIp(v string) { + o.Ip = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *RestartInstanceV1ResponseInner) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestartInstanceV1ResponseInner) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *RestartInstanceV1ResponseInner) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *RestartInstanceV1ResponseInner) SetStatus(v string) { + o.Status = &v +} + +// GetSshKeyNames returns the SshKeyNames field value if set, zero value otherwise. +func (o *RestartInstanceV1ResponseInner) GetSshKeyNames() []string { + if o == nil || IsNil(o.SshKeyNames) { + var ret []string + return ret + } + return o.SshKeyNames +} + +// GetSshKeyNamesOk returns a tuple with the SshKeyNames field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestartInstanceV1ResponseInner) GetSshKeyNamesOk() ([]string, bool) { + if o == nil || IsNil(o.SshKeyNames) { + return nil, false + } + return o.SshKeyNames, true +} + +// HasSshKeyNames returns a boolean if a field has been set. +func (o *RestartInstanceV1ResponseInner) HasSshKeyNames() bool { + if o != nil && !IsNil(o.SshKeyNames) { + return true + } + + return false +} + +// SetSshKeyNames gets a reference to the given []string and assigns it to the SshKeyNames field. +func (o *RestartInstanceV1ResponseInner) SetSshKeyNames(v []string) { + o.SshKeyNames = v +} + +// GetFileSystemNames returns the FileSystemNames field value if set, zero value otherwise. +func (o *RestartInstanceV1ResponseInner) GetFileSystemNames() []string { + if o == nil || IsNil(o.FileSystemNames) { + var ret []string + return ret + } + return o.FileSystemNames +} + +// GetFileSystemNamesOk returns a tuple with the FileSystemNames field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestartInstanceV1ResponseInner) GetFileSystemNamesOk() ([]string, bool) { + if o == nil || IsNil(o.FileSystemNames) { + return nil, false + } + return o.FileSystemNames, true +} + +// HasFileSystemNames returns a boolean if a field has been set. +func (o *RestartInstanceV1ResponseInner) HasFileSystemNames() bool { + if o != nil && !IsNil(o.FileSystemNames) { + return true + } + + return false +} + +// SetFileSystemNames gets a reference to the given []string and assigns it to the FileSystemNames field. +func (o *RestartInstanceV1ResponseInner) SetFileSystemNames(v []string) { + o.FileSystemNames = v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *RestartInstanceV1ResponseInner) GetRegion() RestartInstanceV1ResponseInnerRegion { + if o == nil || IsNil(o.Region) { + var ret RestartInstanceV1ResponseInnerRegion + return ret + } + return *o.Region +} + +// GetRegionOk returns a tuple with the Region field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestartInstanceV1ResponseInner) GetRegionOk() (*RestartInstanceV1ResponseInnerRegion, bool) { + if o == nil || IsNil(o.Region) { + return nil, false + } + return o.Region, true +} + +// HasRegion returns a boolean if a field has been set. +func (o *RestartInstanceV1ResponseInner) HasRegion() bool { + if o != nil && !IsNil(o.Region) { + return true + } + + return false +} + +// SetRegion gets a reference to the given RestartInstanceV1ResponseInnerRegion and assigns it to the Region field. +func (o *RestartInstanceV1ResponseInner) SetRegion(v RestartInstanceV1ResponseInnerRegion) { + o.Region = &v +} + +// GetInstanceType returns the InstanceType field value if set, zero value otherwise. +func (o *RestartInstanceV1ResponseInner) GetInstanceType() RestartInstanceV1ResponseInnerInstanceType { + if o == nil || IsNil(o.InstanceType) { + var ret RestartInstanceV1ResponseInnerInstanceType + return ret + } + return *o.InstanceType +} + +// GetInstanceTypeOk returns a tuple with the InstanceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestartInstanceV1ResponseInner) GetInstanceTypeOk() (*RestartInstanceV1ResponseInnerInstanceType, bool) { + if o == nil || IsNil(o.InstanceType) { + return nil, false + } + return o.InstanceType, true +} + +// HasInstanceType returns a boolean if a field has been set. +func (o *RestartInstanceV1ResponseInner) HasInstanceType() bool { + if o != nil && !IsNil(o.InstanceType) { + return true + } + + return false +} + +// SetInstanceType gets a reference to the given RestartInstanceV1ResponseInnerInstanceType and assigns it to the InstanceType field. +func (o *RestartInstanceV1ResponseInner) SetInstanceType(v RestartInstanceV1ResponseInnerInstanceType) { + o.InstanceType = &v +} + +// GetJupyterToken returns the JupyterToken field value if set, zero value otherwise. +func (o *RestartInstanceV1ResponseInner) GetJupyterToken() string { + if o == nil || IsNil(o.JupyterToken) { + var ret string + return ret + } + return *o.JupyterToken +} + +// GetJupyterTokenOk returns a tuple with the JupyterToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestartInstanceV1ResponseInner) GetJupyterTokenOk() (*string, bool) { + if o == nil || IsNil(o.JupyterToken) { + return nil, false + } + return o.JupyterToken, true +} + +// HasJupyterToken returns a boolean if a field has been set. +func (o *RestartInstanceV1ResponseInner) HasJupyterToken() bool { + if o != nil && !IsNil(o.JupyterToken) { + return true + } + + return false +} + +// SetJupyterToken gets a reference to the given string and assigns it to the JupyterToken field. +func (o *RestartInstanceV1ResponseInner) SetJupyterToken(v string) { + o.JupyterToken = &v +} + +// GetJupyterUrl returns the JupyterUrl field value if set, zero value otherwise. +func (o *RestartInstanceV1ResponseInner) GetJupyterUrl() string { + if o == nil || IsNil(o.JupyterUrl) { + var ret string + return ret + } + return *o.JupyterUrl +} + +// GetJupyterUrlOk returns a tuple with the JupyterUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestartInstanceV1ResponseInner) GetJupyterUrlOk() (*string, bool) { + if o == nil || IsNil(o.JupyterUrl) { + return nil, false + } + return o.JupyterUrl, true +} + +// HasJupyterUrl returns a boolean if a field has been set. +func (o *RestartInstanceV1ResponseInner) HasJupyterUrl() bool { + if o != nil && !IsNil(o.JupyterUrl) { + return true + } + + return false +} + +// SetJupyterUrl gets a reference to the given string and assigns it to the JupyterUrl field. +func (o *RestartInstanceV1ResponseInner) SetJupyterUrl(v string) { + o.JupyterUrl = &v +} + +func (o RestartInstanceV1ResponseInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RestartInstanceV1ResponseInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Ip) { + toSerialize["ip"] = o.Ip + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.SshKeyNames) { + toSerialize["ssh_key_names"] = o.SshKeyNames + } + if !IsNil(o.FileSystemNames) { + toSerialize["file_system_names"] = o.FileSystemNames + } + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + if !IsNil(o.InstanceType) { + toSerialize["instance_type"] = o.InstanceType + } + if !IsNil(o.JupyterToken) { + toSerialize["jupyter_token"] = o.JupyterToken + } + if !IsNil(o.JupyterUrl) { + toSerialize["jupyter_url"] = o.JupyterUrl + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RestartInstanceV1ResponseInner) UnmarshalJSON(data []byte) (err error) { + varRestartInstanceV1ResponseInner := _RestartInstanceV1ResponseInner{} + + err = json.Unmarshal(data, &varRestartInstanceV1ResponseInner) + + if err != nil { + return err + } + + *o = RestartInstanceV1ResponseInner(varRestartInstanceV1ResponseInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "ip") + delete(additionalProperties, "status") + delete(additionalProperties, "ssh_key_names") + delete(additionalProperties, "file_system_names") + delete(additionalProperties, "region") + delete(additionalProperties, "instance_type") + delete(additionalProperties, "jupyter_token") + delete(additionalProperties, "jupyter_url") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRestartInstanceV1ResponseInner struct { + value *RestartInstanceV1ResponseInner + isSet bool +} + +func (v NullableRestartInstanceV1ResponseInner) Get() *RestartInstanceV1ResponseInner { + return v.value +} + +func (v *NullableRestartInstanceV1ResponseInner) Set(val *RestartInstanceV1ResponseInner) { + v.value = val + v.isSet = true +} + +func (v NullableRestartInstanceV1ResponseInner) IsSet() bool { + return v.isSet +} + +func (v *NullableRestartInstanceV1ResponseInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestartInstanceV1ResponseInner(val *RestartInstanceV1ResponseInner) *NullableRestartInstanceV1ResponseInner { + return &NullableRestartInstanceV1ResponseInner{value: val, isSet: true} +} + +func (v NullableRestartInstanceV1ResponseInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestartInstanceV1ResponseInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_restart_instance_v1_response_inner_instance_type.go b/v1/providers/massedcompute/gen/massedcompute/model_restart_instance_v1_response_inner_instance_type.go new file mode 100644 index 0000000..83e49db --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_restart_instance_v1_response_inner_instance_type.go @@ -0,0 +1,264 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the RestartInstanceV1ResponseInnerInstanceType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RestartInstanceV1ResponseInnerInstanceType{} + +// RestartInstanceV1ResponseInnerInstanceType struct for RestartInstanceV1ResponseInnerInstanceType +type RestartInstanceV1ResponseInnerInstanceType struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + PriceCentsPerHour *int32 `json:"price_cents_per_hour,omitempty"` + Specs *RestartInstanceV1ResponseInnerInstanceTypeSpecs `json:"specs,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RestartInstanceV1ResponseInnerInstanceType RestartInstanceV1ResponseInnerInstanceType + +// NewRestartInstanceV1ResponseInnerInstanceType instantiates a new RestartInstanceV1ResponseInnerInstanceType 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 NewRestartInstanceV1ResponseInnerInstanceType() *RestartInstanceV1ResponseInnerInstanceType { + this := RestartInstanceV1ResponseInnerInstanceType{} + return &this +} + +// NewRestartInstanceV1ResponseInnerInstanceTypeWithDefaults instantiates a new RestartInstanceV1ResponseInnerInstanceType 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 NewRestartInstanceV1ResponseInnerInstanceTypeWithDefaults() *RestartInstanceV1ResponseInnerInstanceType { + this := RestartInstanceV1ResponseInnerInstanceType{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *RestartInstanceV1ResponseInnerInstanceType) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestartInstanceV1ResponseInnerInstanceType) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *RestartInstanceV1ResponseInnerInstanceType) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *RestartInstanceV1ResponseInnerInstanceType) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RestartInstanceV1ResponseInnerInstanceType) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestartInstanceV1ResponseInnerInstanceType) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RestartInstanceV1ResponseInnerInstanceType) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RestartInstanceV1ResponseInnerInstanceType) SetDescription(v string) { + o.Description = &v +} + +// GetPriceCentsPerHour returns the PriceCentsPerHour field value if set, zero value otherwise. +func (o *RestartInstanceV1ResponseInnerInstanceType) GetPriceCentsPerHour() int32 { + if o == nil || IsNil(o.PriceCentsPerHour) { + var ret int32 + return ret + } + return *o.PriceCentsPerHour +} + +// GetPriceCentsPerHourOk returns a tuple with the PriceCentsPerHour field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestartInstanceV1ResponseInnerInstanceType) GetPriceCentsPerHourOk() (*int32, bool) { + if o == nil || IsNil(o.PriceCentsPerHour) { + return nil, false + } + return o.PriceCentsPerHour, true +} + +// HasPriceCentsPerHour returns a boolean if a field has been set. +func (o *RestartInstanceV1ResponseInnerInstanceType) HasPriceCentsPerHour() bool { + if o != nil && !IsNil(o.PriceCentsPerHour) { + return true + } + + return false +} + +// SetPriceCentsPerHour gets a reference to the given int32 and assigns it to the PriceCentsPerHour field. +func (o *RestartInstanceV1ResponseInnerInstanceType) SetPriceCentsPerHour(v int32) { + o.PriceCentsPerHour = &v +} + +// GetSpecs returns the Specs field value if set, zero value otherwise. +func (o *RestartInstanceV1ResponseInnerInstanceType) GetSpecs() RestartInstanceV1ResponseInnerInstanceTypeSpecs { + if o == nil || IsNil(o.Specs) { + var ret RestartInstanceV1ResponseInnerInstanceTypeSpecs + return ret + } + return *o.Specs +} + +// GetSpecsOk returns a tuple with the Specs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestartInstanceV1ResponseInnerInstanceType) GetSpecsOk() (*RestartInstanceV1ResponseInnerInstanceTypeSpecs, bool) { + if o == nil || IsNil(o.Specs) { + return nil, false + } + return o.Specs, true +} + +// HasSpecs returns a boolean if a field has been set. +func (o *RestartInstanceV1ResponseInnerInstanceType) HasSpecs() bool { + if o != nil && !IsNil(o.Specs) { + return true + } + + return false +} + +// SetSpecs gets a reference to the given RestartInstanceV1ResponseInnerInstanceTypeSpecs and assigns it to the Specs field. +func (o *RestartInstanceV1ResponseInnerInstanceType) SetSpecs(v RestartInstanceV1ResponseInnerInstanceTypeSpecs) { + o.Specs = &v +} + +func (o RestartInstanceV1ResponseInnerInstanceType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RestartInstanceV1ResponseInnerInstanceType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.PriceCentsPerHour) { + toSerialize["price_cents_per_hour"] = o.PriceCentsPerHour + } + if !IsNil(o.Specs) { + toSerialize["specs"] = o.Specs + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RestartInstanceV1ResponseInnerInstanceType) UnmarshalJSON(data []byte) (err error) { + varRestartInstanceV1ResponseInnerInstanceType := _RestartInstanceV1ResponseInnerInstanceType{} + + err = json.Unmarshal(data, &varRestartInstanceV1ResponseInnerInstanceType) + + if err != nil { + return err + } + + *o = RestartInstanceV1ResponseInnerInstanceType(varRestartInstanceV1ResponseInnerInstanceType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "price_cents_per_hour") + delete(additionalProperties, "specs") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRestartInstanceV1ResponseInnerInstanceType struct { + value *RestartInstanceV1ResponseInnerInstanceType + isSet bool +} + +func (v NullableRestartInstanceV1ResponseInnerInstanceType) Get() *RestartInstanceV1ResponseInnerInstanceType { + return v.value +} + +func (v *NullableRestartInstanceV1ResponseInnerInstanceType) Set(val *RestartInstanceV1ResponseInnerInstanceType) { + v.value = val + v.isSet = true +} + +func (v NullableRestartInstanceV1ResponseInnerInstanceType) IsSet() bool { + return v.isSet +} + +func (v *NullableRestartInstanceV1ResponseInnerInstanceType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestartInstanceV1ResponseInnerInstanceType(val *RestartInstanceV1ResponseInnerInstanceType) *NullableRestartInstanceV1ResponseInnerInstanceType { + return &NullableRestartInstanceV1ResponseInnerInstanceType{value: val, isSet: true} +} + +func (v NullableRestartInstanceV1ResponseInnerInstanceType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestartInstanceV1ResponseInnerInstanceType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_restart_instance_v1_response_inner_instance_type_specs.go b/v1/providers/massedcompute/gen/massedcompute/model_restart_instance_v1_response_inner_instance_type_specs.go new file mode 100644 index 0000000..100a24f --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_restart_instance_v1_response_inner_instance_type_specs.go @@ -0,0 +1,227 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the RestartInstanceV1ResponseInnerInstanceTypeSpecs type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RestartInstanceV1ResponseInnerInstanceTypeSpecs{} + +// RestartInstanceV1ResponseInnerInstanceTypeSpecs struct for RestartInstanceV1ResponseInnerInstanceTypeSpecs +type RestartInstanceV1ResponseInnerInstanceTypeSpecs struct { + Vcpus *int32 `json:"vcpus,omitempty"` + MemoryGib *int32 `json:"memory_gib,omitempty"` + StorageGb *int32 `json:"storage_gb,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RestartInstanceV1ResponseInnerInstanceTypeSpecs RestartInstanceV1ResponseInnerInstanceTypeSpecs + +// NewRestartInstanceV1ResponseInnerInstanceTypeSpecs instantiates a new RestartInstanceV1ResponseInnerInstanceTypeSpecs 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 NewRestartInstanceV1ResponseInnerInstanceTypeSpecs() *RestartInstanceV1ResponseInnerInstanceTypeSpecs { + this := RestartInstanceV1ResponseInnerInstanceTypeSpecs{} + return &this +} + +// NewRestartInstanceV1ResponseInnerInstanceTypeSpecsWithDefaults instantiates a new RestartInstanceV1ResponseInnerInstanceTypeSpecs 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 NewRestartInstanceV1ResponseInnerInstanceTypeSpecsWithDefaults() *RestartInstanceV1ResponseInnerInstanceTypeSpecs { + this := RestartInstanceV1ResponseInnerInstanceTypeSpecs{} + return &this +} + +// GetVcpus returns the Vcpus field value if set, zero value otherwise. +func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) GetVcpus() int32 { + if o == nil || IsNil(o.Vcpus) { + var ret int32 + return ret + } + return *o.Vcpus +} + +// GetVcpusOk returns a tuple with the Vcpus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) GetVcpusOk() (*int32, bool) { + if o == nil || IsNil(o.Vcpus) { + return nil, false + } + return o.Vcpus, true +} + +// HasVcpus returns a boolean if a field has been set. +func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) HasVcpus() bool { + if o != nil && !IsNil(o.Vcpus) { + return true + } + + return false +} + +// SetVcpus gets a reference to the given int32 and assigns it to the Vcpus field. +func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) SetVcpus(v int32) { + o.Vcpus = &v +} + +// GetMemoryGib returns the MemoryGib field value if set, zero value otherwise. +func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) GetMemoryGib() int32 { + if o == nil || IsNil(o.MemoryGib) { + var ret int32 + return ret + } + return *o.MemoryGib +} + +// GetMemoryGibOk returns a tuple with the MemoryGib field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) GetMemoryGibOk() (*int32, bool) { + if o == nil || IsNil(o.MemoryGib) { + return nil, false + } + return o.MemoryGib, true +} + +// HasMemoryGib returns a boolean if a field has been set. +func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) HasMemoryGib() bool { + if o != nil && !IsNil(o.MemoryGib) { + return true + } + + return false +} + +// SetMemoryGib gets a reference to the given int32 and assigns it to the MemoryGib field. +func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) SetMemoryGib(v int32) { + o.MemoryGib = &v +} + +// GetStorageGb returns the StorageGb field value if set, zero value otherwise. +func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) GetStorageGb() int32 { + if o == nil || IsNil(o.StorageGb) { + var ret int32 + return ret + } + return *o.StorageGb +} + +// GetStorageGbOk returns a tuple with the StorageGb field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) GetStorageGbOk() (*int32, bool) { + if o == nil || IsNil(o.StorageGb) { + return nil, false + } + return o.StorageGb, true +} + +// HasStorageGb returns a boolean if a field has been set. +func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) HasStorageGb() bool { + if o != nil && !IsNil(o.StorageGb) { + return true + } + + return false +} + +// SetStorageGb gets a reference to the given int32 and assigns it to the StorageGb field. +func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) SetStorageGb(v int32) { + o.StorageGb = &v +} + +func (o RestartInstanceV1ResponseInnerInstanceTypeSpecs) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RestartInstanceV1ResponseInnerInstanceTypeSpecs) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Vcpus) { + toSerialize["vcpus"] = o.Vcpus + } + if !IsNil(o.MemoryGib) { + toSerialize["memory_gib"] = o.MemoryGib + } + if !IsNil(o.StorageGb) { + toSerialize["storage_gb"] = o.StorageGb + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RestartInstanceV1ResponseInnerInstanceTypeSpecs) UnmarshalJSON(data []byte) (err error) { + varRestartInstanceV1ResponseInnerInstanceTypeSpecs := _RestartInstanceV1ResponseInnerInstanceTypeSpecs{} + + err = json.Unmarshal(data, &varRestartInstanceV1ResponseInnerInstanceTypeSpecs) + + if err != nil { + return err + } + + *o = RestartInstanceV1ResponseInnerInstanceTypeSpecs(varRestartInstanceV1ResponseInnerInstanceTypeSpecs) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "vcpus") + delete(additionalProperties, "memory_gib") + delete(additionalProperties, "storage_gb") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRestartInstanceV1ResponseInnerInstanceTypeSpecs struct { + value *RestartInstanceV1ResponseInnerInstanceTypeSpecs + isSet bool +} + +func (v NullableRestartInstanceV1ResponseInnerInstanceTypeSpecs) Get() *RestartInstanceV1ResponseInnerInstanceTypeSpecs { + return v.value +} + +func (v *NullableRestartInstanceV1ResponseInnerInstanceTypeSpecs) Set(val *RestartInstanceV1ResponseInnerInstanceTypeSpecs) { + v.value = val + v.isSet = true +} + +func (v NullableRestartInstanceV1ResponseInnerInstanceTypeSpecs) IsSet() bool { + return v.isSet +} + +func (v *NullableRestartInstanceV1ResponseInnerInstanceTypeSpecs) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestartInstanceV1ResponseInnerInstanceTypeSpecs(val *RestartInstanceV1ResponseInnerInstanceTypeSpecs) *NullableRestartInstanceV1ResponseInnerInstanceTypeSpecs { + return &NullableRestartInstanceV1ResponseInnerInstanceTypeSpecs{value: val, isSet: true} +} + +func (v NullableRestartInstanceV1ResponseInnerInstanceTypeSpecs) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestartInstanceV1ResponseInnerInstanceTypeSpecs) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_restart_instance_v1_response_inner_region.go b/v1/providers/massedcompute/gen/massedcompute/model_restart_instance_v1_response_inner_region.go new file mode 100644 index 0000000..5824be0 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_restart_instance_v1_response_inner_region.go @@ -0,0 +1,190 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the RestartInstanceV1ResponseInnerRegion type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RestartInstanceV1ResponseInnerRegion{} + +// RestartInstanceV1ResponseInnerRegion struct for RestartInstanceV1ResponseInnerRegion +type RestartInstanceV1ResponseInnerRegion struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RestartInstanceV1ResponseInnerRegion RestartInstanceV1ResponseInnerRegion + +// NewRestartInstanceV1ResponseInnerRegion instantiates a new RestartInstanceV1ResponseInnerRegion 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 NewRestartInstanceV1ResponseInnerRegion() *RestartInstanceV1ResponseInnerRegion { + this := RestartInstanceV1ResponseInnerRegion{} + return &this +} + +// NewRestartInstanceV1ResponseInnerRegionWithDefaults instantiates a new RestartInstanceV1ResponseInnerRegion 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 NewRestartInstanceV1ResponseInnerRegionWithDefaults() *RestartInstanceV1ResponseInnerRegion { + this := RestartInstanceV1ResponseInnerRegion{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *RestartInstanceV1ResponseInnerRegion) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestartInstanceV1ResponseInnerRegion) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *RestartInstanceV1ResponseInnerRegion) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *RestartInstanceV1ResponseInnerRegion) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RestartInstanceV1ResponseInnerRegion) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestartInstanceV1ResponseInnerRegion) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RestartInstanceV1ResponseInnerRegion) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RestartInstanceV1ResponseInnerRegion) SetDescription(v string) { + o.Description = &v +} + +func (o RestartInstanceV1ResponseInnerRegion) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RestartInstanceV1ResponseInnerRegion) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RestartInstanceV1ResponseInnerRegion) UnmarshalJSON(data []byte) (err error) { + varRestartInstanceV1ResponseInnerRegion := _RestartInstanceV1ResponseInnerRegion{} + + err = json.Unmarshal(data, &varRestartInstanceV1ResponseInnerRegion) + + if err != nil { + return err + } + + *o = RestartInstanceV1ResponseInnerRegion(varRestartInstanceV1ResponseInnerRegion) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRestartInstanceV1ResponseInnerRegion struct { + value *RestartInstanceV1ResponseInnerRegion + isSet bool +} + +func (v NullableRestartInstanceV1ResponseInnerRegion) Get() *RestartInstanceV1ResponseInnerRegion { + return v.value +} + +func (v *NullableRestartInstanceV1ResponseInnerRegion) Set(val *RestartInstanceV1ResponseInnerRegion) { + v.value = val + v.isSet = true +} + +func (v NullableRestartInstanceV1ResponseInnerRegion) IsSet() bool { + return v.isSet +} + +func (v *NullableRestartInstanceV1ResponseInnerRegion) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestartInstanceV1ResponseInnerRegion(val *RestartInstanceV1ResponseInnerRegion) *NullableRestartInstanceV1ResponseInnerRegion { + return &NullableRestartInstanceV1ResponseInnerRegion{value: val, isSet: true} +} + +func (v NullableRestartInstanceV1ResponseInnerRegion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestartInstanceV1ResponseInnerRegion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_retrieve_accept_products_v1.go b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_accept_products_v1.go new file mode 100644 index 0000000..220a71f --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_accept_products_v1.go @@ -0,0 +1,153 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the RetrieveAcceptProductsV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RetrieveAcceptProductsV1{} + +// RetrieveAcceptProductsV1 struct for RetrieveAcceptProductsV1 +type RetrieveAcceptProductsV1 struct { + CouponValidation *RetrieveAcceptProductsV1CouponValidation `json:"couponValidation,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RetrieveAcceptProductsV1 RetrieveAcceptProductsV1 + +// NewRetrieveAcceptProductsV1 instantiates a new RetrieveAcceptProductsV1 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 NewRetrieveAcceptProductsV1() *RetrieveAcceptProductsV1 { + this := RetrieveAcceptProductsV1{} + return &this +} + +// NewRetrieveAcceptProductsV1WithDefaults instantiates a new RetrieveAcceptProductsV1 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 NewRetrieveAcceptProductsV1WithDefaults() *RetrieveAcceptProductsV1 { + this := RetrieveAcceptProductsV1{} + return &this +} + +// GetCouponValidation returns the CouponValidation field value if set, zero value otherwise. +func (o *RetrieveAcceptProductsV1) GetCouponValidation() RetrieveAcceptProductsV1CouponValidation { + if o == nil || IsNil(o.CouponValidation) { + var ret RetrieveAcceptProductsV1CouponValidation + return ret + } + return *o.CouponValidation +} + +// GetCouponValidationOk returns a tuple with the CouponValidation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAcceptProductsV1) GetCouponValidationOk() (*RetrieveAcceptProductsV1CouponValidation, bool) { + if o == nil || IsNil(o.CouponValidation) { + return nil, false + } + return o.CouponValidation, true +} + +// HasCouponValidation returns a boolean if a field has been set. +func (o *RetrieveAcceptProductsV1) HasCouponValidation() bool { + if o != nil && !IsNil(o.CouponValidation) { + return true + } + + return false +} + +// SetCouponValidation gets a reference to the given RetrieveAcceptProductsV1CouponValidation and assigns it to the CouponValidation field. +func (o *RetrieveAcceptProductsV1) SetCouponValidation(v RetrieveAcceptProductsV1CouponValidation) { + o.CouponValidation = &v +} + +func (o RetrieveAcceptProductsV1) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RetrieveAcceptProductsV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CouponValidation) { + toSerialize["couponValidation"] = o.CouponValidation + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RetrieveAcceptProductsV1) UnmarshalJSON(data []byte) (err error) { + varRetrieveAcceptProductsV1 := _RetrieveAcceptProductsV1{} + + err = json.Unmarshal(data, &varRetrieveAcceptProductsV1) + + if err != nil { + return err + } + + *o = RetrieveAcceptProductsV1(varRetrieveAcceptProductsV1) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "couponValidation") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRetrieveAcceptProductsV1 struct { + value *RetrieveAcceptProductsV1 + isSet bool +} + +func (v NullableRetrieveAcceptProductsV1) Get() *RetrieveAcceptProductsV1 { + return v.value +} + +func (v *NullableRetrieveAcceptProductsV1) Set(val *RetrieveAcceptProductsV1) { + v.value = val + v.isSet = true +} + +func (v NullableRetrieveAcceptProductsV1) IsSet() bool { + return v.isSet +} + +func (v *NullableRetrieveAcceptProductsV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRetrieveAcceptProductsV1(val *RetrieveAcceptProductsV1) *NullableRetrieveAcceptProductsV1 { + return &NullableRetrieveAcceptProductsV1{value: val, isSet: true} +} + +func (v NullableRetrieveAcceptProductsV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRetrieveAcceptProductsV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_retrieve_accept_products_v1_coupon_validation.go b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_accept_products_v1_coupon_validation.go new file mode 100644 index 0000000..915a8ca --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_accept_products_v1_coupon_validation.go @@ -0,0 +1,190 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the RetrieveAcceptProductsV1CouponValidation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RetrieveAcceptProductsV1CouponValidation{} + +// RetrieveAcceptProductsV1CouponValidation struct for RetrieveAcceptProductsV1CouponValidation +type RetrieveAcceptProductsV1CouponValidation struct { + Coupon *RetrieveCouponInformationV1Coupon `json:"coupon,omitempty"` + ProductDetails []RetrieveAcceptProductsV1CouponValidationProductDetailsInner `json:"productDetails,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RetrieveAcceptProductsV1CouponValidation RetrieveAcceptProductsV1CouponValidation + +// NewRetrieveAcceptProductsV1CouponValidation instantiates a new RetrieveAcceptProductsV1CouponValidation 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 NewRetrieveAcceptProductsV1CouponValidation() *RetrieveAcceptProductsV1CouponValidation { + this := RetrieveAcceptProductsV1CouponValidation{} + return &this +} + +// NewRetrieveAcceptProductsV1CouponValidationWithDefaults instantiates a new RetrieveAcceptProductsV1CouponValidation 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 NewRetrieveAcceptProductsV1CouponValidationWithDefaults() *RetrieveAcceptProductsV1CouponValidation { + this := RetrieveAcceptProductsV1CouponValidation{} + return &this +} + +// GetCoupon returns the Coupon field value if set, zero value otherwise. +func (o *RetrieveAcceptProductsV1CouponValidation) GetCoupon() RetrieveCouponInformationV1Coupon { + if o == nil || IsNil(o.Coupon) { + var ret RetrieveCouponInformationV1Coupon + return ret + } + return *o.Coupon +} + +// GetCouponOk returns a tuple with the Coupon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAcceptProductsV1CouponValidation) GetCouponOk() (*RetrieveCouponInformationV1Coupon, bool) { + if o == nil || IsNil(o.Coupon) { + return nil, false + } + return o.Coupon, true +} + +// HasCoupon returns a boolean if a field has been set. +func (o *RetrieveAcceptProductsV1CouponValidation) HasCoupon() bool { + if o != nil && !IsNil(o.Coupon) { + return true + } + + return false +} + +// SetCoupon gets a reference to the given RetrieveCouponInformationV1Coupon and assigns it to the Coupon field. +func (o *RetrieveAcceptProductsV1CouponValidation) SetCoupon(v RetrieveCouponInformationV1Coupon) { + o.Coupon = &v +} + +// GetProductDetails returns the ProductDetails field value if set, zero value otherwise. +func (o *RetrieveAcceptProductsV1CouponValidation) GetProductDetails() []RetrieveAcceptProductsV1CouponValidationProductDetailsInner { + if o == nil || IsNil(o.ProductDetails) { + var ret []RetrieveAcceptProductsV1CouponValidationProductDetailsInner + return ret + } + return o.ProductDetails +} + +// GetProductDetailsOk returns a tuple with the ProductDetails field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAcceptProductsV1CouponValidation) GetProductDetailsOk() ([]RetrieveAcceptProductsV1CouponValidationProductDetailsInner, bool) { + if o == nil || IsNil(o.ProductDetails) { + return nil, false + } + return o.ProductDetails, true +} + +// HasProductDetails returns a boolean if a field has been set. +func (o *RetrieveAcceptProductsV1CouponValidation) HasProductDetails() bool { + if o != nil && !IsNil(o.ProductDetails) { + return true + } + + return false +} + +// SetProductDetails gets a reference to the given []RetrieveAcceptProductsV1CouponValidationProductDetailsInner and assigns it to the ProductDetails field. +func (o *RetrieveAcceptProductsV1CouponValidation) SetProductDetails(v []RetrieveAcceptProductsV1CouponValidationProductDetailsInner) { + o.ProductDetails = v +} + +func (o RetrieveAcceptProductsV1CouponValidation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RetrieveAcceptProductsV1CouponValidation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Coupon) { + toSerialize["coupon"] = o.Coupon + } + if !IsNil(o.ProductDetails) { + toSerialize["productDetails"] = o.ProductDetails + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RetrieveAcceptProductsV1CouponValidation) UnmarshalJSON(data []byte) (err error) { + varRetrieveAcceptProductsV1CouponValidation := _RetrieveAcceptProductsV1CouponValidation{} + + err = json.Unmarshal(data, &varRetrieveAcceptProductsV1CouponValidation) + + if err != nil { + return err + } + + *o = RetrieveAcceptProductsV1CouponValidation(varRetrieveAcceptProductsV1CouponValidation) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "coupon") + delete(additionalProperties, "productDetails") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRetrieveAcceptProductsV1CouponValidation struct { + value *RetrieveAcceptProductsV1CouponValidation + isSet bool +} + +func (v NullableRetrieveAcceptProductsV1CouponValidation) Get() *RetrieveAcceptProductsV1CouponValidation { + return v.value +} + +func (v *NullableRetrieveAcceptProductsV1CouponValidation) Set(val *RetrieveAcceptProductsV1CouponValidation) { + v.value = val + v.isSet = true +} + +func (v NullableRetrieveAcceptProductsV1CouponValidation) IsSet() bool { + return v.isSet +} + +func (v *NullableRetrieveAcceptProductsV1CouponValidation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRetrieveAcceptProductsV1CouponValidation(val *RetrieveAcceptProductsV1CouponValidation) *NullableRetrieveAcceptProductsV1CouponValidation { + return &NullableRetrieveAcceptProductsV1CouponValidation{value: val, isSet: true} +} + +func (v NullableRetrieveAcceptProductsV1CouponValidation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRetrieveAcceptProductsV1CouponValidation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_retrieve_accept_products_v1_coupon_validation_product_details_inner.go b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_accept_products_v1_coupon_validation_product_details_inner.go new file mode 100644 index 0000000..e8fdb63 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_accept_products_v1_coupon_validation_product_details_inner.go @@ -0,0 +1,264 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the RetrieveAcceptProductsV1CouponValidationProductDetailsInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RetrieveAcceptProductsV1CouponValidationProductDetailsInner{} + +// RetrieveAcceptProductsV1CouponValidationProductDetailsInner struct for RetrieveAcceptProductsV1CouponValidationProductDetailsInner +type RetrieveAcceptProductsV1CouponValidationProductDetailsInner struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + PricePerHour *string `json:"pricePerHour,omitempty"` + InventoryAvailable *bool `json:"inventoryAvailable,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RetrieveAcceptProductsV1CouponValidationProductDetailsInner RetrieveAcceptProductsV1CouponValidationProductDetailsInner + +// NewRetrieveAcceptProductsV1CouponValidationProductDetailsInner instantiates a new RetrieveAcceptProductsV1CouponValidationProductDetailsInner 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 NewRetrieveAcceptProductsV1CouponValidationProductDetailsInner() *RetrieveAcceptProductsV1CouponValidationProductDetailsInner { + this := RetrieveAcceptProductsV1CouponValidationProductDetailsInner{} + return &this +} + +// NewRetrieveAcceptProductsV1CouponValidationProductDetailsInnerWithDefaults instantiates a new RetrieveAcceptProductsV1CouponValidationProductDetailsInner 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 NewRetrieveAcceptProductsV1CouponValidationProductDetailsInnerWithDefaults() *RetrieveAcceptProductsV1CouponValidationProductDetailsInner { + this := RetrieveAcceptProductsV1CouponValidationProductDetailsInner{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) SetDescription(v string) { + o.Description = &v +} + +// GetPricePerHour returns the PricePerHour field value if set, zero value otherwise. +func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) GetPricePerHour() string { + if o == nil || IsNil(o.PricePerHour) { + var ret string + return ret + } + return *o.PricePerHour +} + +// GetPricePerHourOk returns a tuple with the PricePerHour field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) GetPricePerHourOk() (*string, bool) { + if o == nil || IsNil(o.PricePerHour) { + return nil, false + } + return o.PricePerHour, true +} + +// HasPricePerHour returns a boolean if a field has been set. +func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) HasPricePerHour() bool { + if o != nil && !IsNil(o.PricePerHour) { + return true + } + + return false +} + +// SetPricePerHour gets a reference to the given string and assigns it to the PricePerHour field. +func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) SetPricePerHour(v string) { + o.PricePerHour = &v +} + +// GetInventoryAvailable returns the InventoryAvailable field value if set, zero value otherwise. +func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) GetInventoryAvailable() bool { + if o == nil || IsNil(o.InventoryAvailable) { + var ret bool + return ret + } + return *o.InventoryAvailable +} + +// GetInventoryAvailableOk returns a tuple with the InventoryAvailable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) GetInventoryAvailableOk() (*bool, bool) { + if o == nil || IsNil(o.InventoryAvailable) { + return nil, false + } + return o.InventoryAvailable, true +} + +// HasInventoryAvailable returns a boolean if a field has been set. +func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) HasInventoryAvailable() bool { + if o != nil && !IsNil(o.InventoryAvailable) { + return true + } + + return false +} + +// SetInventoryAvailable gets a reference to the given bool and assigns it to the InventoryAvailable field. +func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) SetInventoryAvailable(v bool) { + o.InventoryAvailable = &v +} + +func (o RetrieveAcceptProductsV1CouponValidationProductDetailsInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RetrieveAcceptProductsV1CouponValidationProductDetailsInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.PricePerHour) { + toSerialize["pricePerHour"] = o.PricePerHour + } + if !IsNil(o.InventoryAvailable) { + toSerialize["inventoryAvailable"] = o.InventoryAvailable + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) UnmarshalJSON(data []byte) (err error) { + varRetrieveAcceptProductsV1CouponValidationProductDetailsInner := _RetrieveAcceptProductsV1CouponValidationProductDetailsInner{} + + err = json.Unmarshal(data, &varRetrieveAcceptProductsV1CouponValidationProductDetailsInner) + + if err != nil { + return err + } + + *o = RetrieveAcceptProductsV1CouponValidationProductDetailsInner(varRetrieveAcceptProductsV1CouponValidationProductDetailsInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "pricePerHour") + delete(additionalProperties, "inventoryAvailable") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRetrieveAcceptProductsV1CouponValidationProductDetailsInner struct { + value *RetrieveAcceptProductsV1CouponValidationProductDetailsInner + isSet bool +} + +func (v NullableRetrieveAcceptProductsV1CouponValidationProductDetailsInner) Get() *RetrieveAcceptProductsV1CouponValidationProductDetailsInner { + return v.value +} + +func (v *NullableRetrieveAcceptProductsV1CouponValidationProductDetailsInner) Set(val *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) { + v.value = val + v.isSet = true +} + +func (v NullableRetrieveAcceptProductsV1CouponValidationProductDetailsInner) IsSet() bool { + return v.isSet +} + +func (v *NullableRetrieveAcceptProductsV1CouponValidationProductDetailsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRetrieveAcceptProductsV1CouponValidationProductDetailsInner(val *RetrieveAcceptProductsV1CouponValidationProductDetailsInner) *NullableRetrieveAcceptProductsV1CouponValidationProductDetailsInner { + return &NullableRetrieveAcceptProductsV1CouponValidationProductDetailsInner{value: val, isSet: true} +} + +func (v NullableRetrieveAcceptProductsV1CouponValidationProductDetailsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRetrieveAcceptProductsV1CouponValidationProductDetailsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_retrieve_all_running_instances_v1.go b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_all_running_instances_v1.go new file mode 100644 index 0000000..6a943e0 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_all_running_instances_v1.go @@ -0,0 +1,153 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the RetrieveAllRunningInstancesV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RetrieveAllRunningInstancesV1{} + +// RetrieveAllRunningInstancesV1 struct for RetrieveAllRunningInstancesV1 +type RetrieveAllRunningInstancesV1 struct { + RunningInstances []RetrieveAllRunningInstancesV1RunningInstancesInner `json:"runningInstances,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RetrieveAllRunningInstancesV1 RetrieveAllRunningInstancesV1 + +// NewRetrieveAllRunningInstancesV1 instantiates a new RetrieveAllRunningInstancesV1 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 NewRetrieveAllRunningInstancesV1() *RetrieveAllRunningInstancesV1 { + this := RetrieveAllRunningInstancesV1{} + return &this +} + +// NewRetrieveAllRunningInstancesV1WithDefaults instantiates a new RetrieveAllRunningInstancesV1 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 NewRetrieveAllRunningInstancesV1WithDefaults() *RetrieveAllRunningInstancesV1 { + this := RetrieveAllRunningInstancesV1{} + return &this +} + +// GetRunningInstances returns the RunningInstances field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1) GetRunningInstances() []RetrieveAllRunningInstancesV1RunningInstancesInner { + if o == nil || IsNil(o.RunningInstances) { + var ret []RetrieveAllRunningInstancesV1RunningInstancesInner + return ret + } + return o.RunningInstances +} + +// GetRunningInstancesOk returns a tuple with the RunningInstances field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1) GetRunningInstancesOk() ([]RetrieveAllRunningInstancesV1RunningInstancesInner, bool) { + if o == nil || IsNil(o.RunningInstances) { + return nil, false + } + return o.RunningInstances, true +} + +// HasRunningInstances returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1) HasRunningInstances() bool { + if o != nil && !IsNil(o.RunningInstances) { + return true + } + + return false +} + +// SetRunningInstances gets a reference to the given []RetrieveAllRunningInstancesV1RunningInstancesInner and assigns it to the RunningInstances field. +func (o *RetrieveAllRunningInstancesV1) SetRunningInstances(v []RetrieveAllRunningInstancesV1RunningInstancesInner) { + o.RunningInstances = v +} + +func (o RetrieveAllRunningInstancesV1) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RetrieveAllRunningInstancesV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.RunningInstances) { + toSerialize["runningInstances"] = o.RunningInstances + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RetrieveAllRunningInstancesV1) UnmarshalJSON(data []byte) (err error) { + varRetrieveAllRunningInstancesV1 := _RetrieveAllRunningInstancesV1{} + + err = json.Unmarshal(data, &varRetrieveAllRunningInstancesV1) + + if err != nil { + return err + } + + *o = RetrieveAllRunningInstancesV1(varRetrieveAllRunningInstancesV1) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "runningInstances") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRetrieveAllRunningInstancesV1 struct { + value *RetrieveAllRunningInstancesV1 + isSet bool +} + +func (v NullableRetrieveAllRunningInstancesV1) Get() *RetrieveAllRunningInstancesV1 { + return v.value +} + +func (v *NullableRetrieveAllRunningInstancesV1) Set(val *RetrieveAllRunningInstancesV1) { + v.value = val + v.isSet = true +} + +func (v NullableRetrieveAllRunningInstancesV1) IsSet() bool { + return v.isSet +} + +func (v *NullableRetrieveAllRunningInstancesV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRetrieveAllRunningInstancesV1(val *RetrieveAllRunningInstancesV1) *NullableRetrieveAllRunningInstancesV1 { + return &NullableRetrieveAllRunningInstancesV1{value: val, isSet: true} +} + +func (v NullableRetrieveAllRunningInstancesV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRetrieveAllRunningInstancesV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_retrieve_all_running_instances_v1_running_instances_inner.go b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_all_running_instances_v1_running_instances_inner.go new file mode 100644 index 0000000..21c32be --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_all_running_instances_v1_running_instances_inner.go @@ -0,0 +1,560 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the RetrieveAllRunningInstancesV1RunningInstancesInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RetrieveAllRunningInstancesV1RunningInstancesInner{} + +// RetrieveAllRunningInstancesV1RunningInstancesInner struct for RetrieveAllRunningInstancesV1RunningInstancesInner +type RetrieveAllRunningInstancesV1RunningInstancesInner struct { + Uuid *string `json:"uuid,omitempty"` + Name *string `json:"name,omitempty"` + Ip *string `json:"ip,omitempty"` + Username *string `json:"username,omitempty"` + Password *string `json:"password,omitempty"` + Status *string `json:"status,omitempty"` + OsBooted *int32 `json:"os_booted,omitempty"` + CommandStartup *string `json:"command_startup,omitempty"` + Created *string `json:"created,omitempty"` + Active *int32 `json:"active,omitempty"` + Image *RetrieveAllRunningInstancesV1RunningInstancesInnerImage `json:"image,omitempty"` + Product *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct `json:"product,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RetrieveAllRunningInstancesV1RunningInstancesInner RetrieveAllRunningInstancesV1RunningInstancesInner + +// NewRetrieveAllRunningInstancesV1RunningInstancesInner instantiates a new RetrieveAllRunningInstancesV1RunningInstancesInner 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 NewRetrieveAllRunningInstancesV1RunningInstancesInner() *RetrieveAllRunningInstancesV1RunningInstancesInner { + this := RetrieveAllRunningInstancesV1RunningInstancesInner{} + return &this +} + +// NewRetrieveAllRunningInstancesV1RunningInstancesInnerWithDefaults instantiates a new RetrieveAllRunningInstancesV1RunningInstancesInner 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 NewRetrieveAllRunningInstancesV1RunningInstancesInnerWithDefaults() *RetrieveAllRunningInstancesV1RunningInstancesInner { + this := RetrieveAllRunningInstancesV1RunningInstancesInner{} + return &this +} + +// GetUuid returns the Uuid field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetUuid() string { + if o == nil || IsNil(o.Uuid) { + var ret string + return ret + } + return *o.Uuid +} + +// GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetUuidOk() (*string, bool) { + if o == nil || IsNil(o.Uuid) { + return nil, false + } + return o.Uuid, true +} + +// HasUuid returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasUuid() bool { + if o != nil && !IsNil(o.Uuid) { + return true + } + + return false +} + +// SetUuid gets a reference to the given string and assigns it to the Uuid field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetUuid(v string) { + o.Uuid = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetName(v string) { + o.Name = &v +} + +// GetIp returns the Ip field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetIp() string { + if o == nil || IsNil(o.Ip) { + var ret string + return ret + } + return *o.Ip +} + +// GetIpOk returns a tuple with the Ip field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetIpOk() (*string, bool) { + if o == nil || IsNil(o.Ip) { + return nil, false + } + return o.Ip, true +} + +// HasIp returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasIp() bool { + if o != nil && !IsNil(o.Ip) { + return true + } + + return false +} + +// SetIp gets a reference to the given string and assigns it to the Ip field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetIp(v string) { + o.Ip = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetUsername(v string) { + o.Username = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) 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 *RetrieveAllRunningInstancesV1RunningInstancesInner) 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 *RetrieveAllRunningInstancesV1RunningInstancesInner) 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 *RetrieveAllRunningInstancesV1RunningInstancesInner) SetPassword(v string) { + o.Password = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetStatus(v string) { + o.Status = &v +} + +// GetOsBooted returns the OsBooted field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetOsBooted() int32 { + if o == nil || IsNil(o.OsBooted) { + var ret int32 + return ret + } + return *o.OsBooted +} + +// GetOsBootedOk returns a tuple with the OsBooted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetOsBootedOk() (*int32, bool) { + if o == nil || IsNil(o.OsBooted) { + return nil, false + } + return o.OsBooted, true +} + +// HasOsBooted returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasOsBooted() bool { + if o != nil && !IsNil(o.OsBooted) { + return true + } + + return false +} + +// SetOsBooted gets a reference to the given int32 and assigns it to the OsBooted field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetOsBooted(v int32) { + o.OsBooted = &v +} + +// GetCommandStartup returns the CommandStartup field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetCommandStartup() string { + if o == nil || IsNil(o.CommandStartup) { + var ret string + return ret + } + return *o.CommandStartup +} + +// GetCommandStartupOk returns a tuple with the CommandStartup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetCommandStartupOk() (*string, bool) { + if o == nil || IsNil(o.CommandStartup) { + return nil, false + } + return o.CommandStartup, true +} + +// HasCommandStartup returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasCommandStartup() bool { + if o != nil && !IsNil(o.CommandStartup) { + return true + } + + return false +} + +// SetCommandStartup gets a reference to the given string and assigns it to the CommandStartup field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetCommandStartup(v string) { + o.CommandStartup = &v +} + +// GetCreated returns the Created field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetCreated() string { + if o == nil || IsNil(o.Created) { + var ret string + return ret + } + return *o.Created +} + +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetCreatedOk() (*string, bool) { + if o == nil || IsNil(o.Created) { + return nil, false + } + return o.Created, true +} + +// HasCreated returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasCreated() bool { + if o != nil && !IsNil(o.Created) { + return true + } + + return false +} + +// SetCreated gets a reference to the given string and assigns it to the Created field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetCreated(v string) { + o.Created = &v +} + +// GetActive returns the Active field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetActive() int32 { + if o == nil || IsNil(o.Active) { + var ret int32 + 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 *RetrieveAllRunningInstancesV1RunningInstancesInner) GetActiveOk() (*int32, 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 *RetrieveAllRunningInstancesV1RunningInstancesInner) HasActive() bool { + if o != nil && !IsNil(o.Active) { + return true + } + + return false +} + +// SetActive gets a reference to the given int32 and assigns it to the Active field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetActive(v int32) { + o.Active = &v +} + +// GetImage returns the Image field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetImage() RetrieveAllRunningInstancesV1RunningInstancesInnerImage { + if o == nil || IsNil(o.Image) { + var ret RetrieveAllRunningInstancesV1RunningInstancesInnerImage + return ret + } + return *o.Image +} + +// GetImageOk returns a tuple with the Image field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetImageOk() (*RetrieveAllRunningInstancesV1RunningInstancesInnerImage, bool) { + if o == nil || IsNil(o.Image) { + return nil, false + } + return o.Image, true +} + +// HasImage returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasImage() bool { + if o != nil && !IsNil(o.Image) { + return true + } + + return false +} + +// SetImage gets a reference to the given RetrieveAllRunningInstancesV1RunningInstancesInnerImage and assigns it to the Image field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetImage(v RetrieveAllRunningInstancesV1RunningInstancesInnerImage) { + o.Image = &v +} + +// GetProduct returns the Product field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetProduct() RetrieveAllRunningInstancesV1RunningInstancesInnerProduct { + if o == nil || IsNil(o.Product) { + var ret RetrieveAllRunningInstancesV1RunningInstancesInnerProduct + return ret + } + return *o.Product +} + +// GetProductOk returns a tuple with the Product field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) GetProductOk() (*RetrieveAllRunningInstancesV1RunningInstancesInnerProduct, bool) { + if o == nil || IsNil(o.Product) { + return nil, false + } + return o.Product, true +} + +// HasProduct returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) HasProduct() bool { + if o != nil && !IsNil(o.Product) { + return true + } + + return false +} + +// SetProduct gets a reference to the given RetrieveAllRunningInstancesV1RunningInstancesInnerProduct and assigns it to the Product field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) SetProduct(v RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) { + o.Product = &v +} + +func (o RetrieveAllRunningInstancesV1RunningInstancesInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RetrieveAllRunningInstancesV1RunningInstancesInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Uuid) { + toSerialize["uuid"] = o.Uuid + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Ip) { + toSerialize["ip"] = o.Ip + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + if !IsNil(o.Password) { + toSerialize["password"] = o.Password + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.OsBooted) { + toSerialize["os_booted"] = o.OsBooted + } + if !IsNil(o.CommandStartup) { + toSerialize["command_startup"] = o.CommandStartup + } + if !IsNil(o.Created) { + toSerialize["created"] = o.Created + } + if !IsNil(o.Active) { + toSerialize["active"] = o.Active + } + if !IsNil(o.Image) { + toSerialize["image"] = o.Image + } + if !IsNil(o.Product) { + toSerialize["product"] = o.Product + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RetrieveAllRunningInstancesV1RunningInstancesInner) UnmarshalJSON(data []byte) (err error) { + varRetrieveAllRunningInstancesV1RunningInstancesInner := _RetrieveAllRunningInstancesV1RunningInstancesInner{} + + err = json.Unmarshal(data, &varRetrieveAllRunningInstancesV1RunningInstancesInner) + + if err != nil { + return err + } + + *o = RetrieveAllRunningInstancesV1RunningInstancesInner(varRetrieveAllRunningInstancesV1RunningInstancesInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "uuid") + delete(additionalProperties, "name") + delete(additionalProperties, "ip") + delete(additionalProperties, "username") + delete(additionalProperties, "password") + delete(additionalProperties, "status") + delete(additionalProperties, "os_booted") + delete(additionalProperties, "command_startup") + delete(additionalProperties, "created") + delete(additionalProperties, "active") + delete(additionalProperties, "image") + delete(additionalProperties, "product") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRetrieveAllRunningInstancesV1RunningInstancesInner struct { + value *RetrieveAllRunningInstancesV1RunningInstancesInner + isSet bool +} + +func (v NullableRetrieveAllRunningInstancesV1RunningInstancesInner) Get() *RetrieveAllRunningInstancesV1RunningInstancesInner { + return v.value +} + +func (v *NullableRetrieveAllRunningInstancesV1RunningInstancesInner) Set(val *RetrieveAllRunningInstancesV1RunningInstancesInner) { + v.value = val + v.isSet = true +} + +func (v NullableRetrieveAllRunningInstancesV1RunningInstancesInner) IsSet() bool { + return v.isSet +} + +func (v *NullableRetrieveAllRunningInstancesV1RunningInstancesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRetrieveAllRunningInstancesV1RunningInstancesInner(val *RetrieveAllRunningInstancesV1RunningInstancesInner) *NullableRetrieveAllRunningInstancesV1RunningInstancesInner { + return &NullableRetrieveAllRunningInstancesV1RunningInstancesInner{value: val, isSet: true} +} + +func (v NullableRetrieveAllRunningInstancesV1RunningInstancesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRetrieveAllRunningInstancesV1RunningInstancesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_retrieve_all_running_instances_v1_running_instances_inner_image.go b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_all_running_instances_v1_running_instances_inner_image.go new file mode 100644 index 0000000..9a01928 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_all_running_instances_v1_running_instances_inner_image.go @@ -0,0 +1,227 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the RetrieveAllRunningInstancesV1RunningInstancesInnerImage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RetrieveAllRunningInstancesV1RunningInstancesInnerImage{} + +// RetrieveAllRunningInstancesV1RunningInstancesInnerImage struct for RetrieveAllRunningInstancesV1RunningInstancesInnerImage +type RetrieveAllRunningInstancesV1RunningInstancesInnerImage struct { + Id *int32 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RetrieveAllRunningInstancesV1RunningInstancesInnerImage RetrieveAllRunningInstancesV1RunningInstancesInnerImage + +// NewRetrieveAllRunningInstancesV1RunningInstancesInnerImage instantiates a new RetrieveAllRunningInstancesV1RunningInstancesInnerImage 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 NewRetrieveAllRunningInstancesV1RunningInstancesInnerImage() *RetrieveAllRunningInstancesV1RunningInstancesInnerImage { + this := RetrieveAllRunningInstancesV1RunningInstancesInnerImage{} + return &this +} + +// NewRetrieveAllRunningInstancesV1RunningInstancesInnerImageWithDefaults instantiates a new RetrieveAllRunningInstancesV1RunningInstancesInnerImage 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 NewRetrieveAllRunningInstancesV1RunningInstancesInnerImageWithDefaults() *RetrieveAllRunningInstancesV1RunningInstancesInnerImage { + this := RetrieveAllRunningInstancesV1RunningInstancesInnerImage{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) GetId() int32 { + if o == nil || IsNil(o.Id) { + var ret int32 + 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 *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) GetIdOk() (*int32, 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 *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given int32 and assigns it to the Id field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) SetId(v int32) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) SetDescription(v string) { + o.Description = &v +} + +func (o RetrieveAllRunningInstancesV1RunningInstancesInnerImage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RetrieveAllRunningInstancesV1RunningInstancesInnerImage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) UnmarshalJSON(data []byte) (err error) { + varRetrieveAllRunningInstancesV1RunningInstancesInnerImage := _RetrieveAllRunningInstancesV1RunningInstancesInnerImage{} + + err = json.Unmarshal(data, &varRetrieveAllRunningInstancesV1RunningInstancesInnerImage) + + if err != nil { + return err + } + + *o = RetrieveAllRunningInstancesV1RunningInstancesInnerImage(varRetrieveAllRunningInstancesV1RunningInstancesInnerImage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRetrieveAllRunningInstancesV1RunningInstancesInnerImage struct { + value *RetrieveAllRunningInstancesV1RunningInstancesInnerImage + isSet bool +} + +func (v NullableRetrieveAllRunningInstancesV1RunningInstancesInnerImage) Get() *RetrieveAllRunningInstancesV1RunningInstancesInnerImage { + return v.value +} + +func (v *NullableRetrieveAllRunningInstancesV1RunningInstancesInnerImage) Set(val *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) { + v.value = val + v.isSet = true +} + +func (v NullableRetrieveAllRunningInstancesV1RunningInstancesInnerImage) IsSet() bool { + return v.isSet +} + +func (v *NullableRetrieveAllRunningInstancesV1RunningInstancesInnerImage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRetrieveAllRunningInstancesV1RunningInstancesInnerImage(val *RetrieveAllRunningInstancesV1RunningInstancesInnerImage) *NullableRetrieveAllRunningInstancesV1RunningInstancesInnerImage { + return &NullableRetrieveAllRunningInstancesV1RunningInstancesInnerImage{value: val, isSet: true} +} + +func (v NullableRetrieveAllRunningInstancesV1RunningInstancesInnerImage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRetrieveAllRunningInstancesV1RunningInstancesInnerImage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_retrieve_all_running_instances_v1_running_instances_inner_product.go b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_all_running_instances_v1_running_instances_inner_product.go new file mode 100644 index 0000000..72a1555 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_all_running_instances_v1_running_instances_inner_product.go @@ -0,0 +1,412 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the RetrieveAllRunningInstancesV1RunningInstancesInnerProduct type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RetrieveAllRunningInstancesV1RunningInstancesInnerProduct{} + +// RetrieveAllRunningInstancesV1RunningInstancesInnerProduct struct for RetrieveAllRunningInstancesV1RunningInstancesInnerProduct +type RetrieveAllRunningInstancesV1RunningInstancesInnerProduct struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + GpuCount *int32 `json:"gpu_count,omitempty"` + Vcpu *int32 `json:"vcpu,omitempty"` + Ram *int32 `json:"ram,omitempty"` + Storage *int32 `json:"storage,omitempty"` + PriceHr *string `json:"price_hr,omitempty"` + FinalPriceHr *string `json:"final_price_hr,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RetrieveAllRunningInstancesV1RunningInstancesInnerProduct RetrieveAllRunningInstancesV1RunningInstancesInnerProduct + +// NewRetrieveAllRunningInstancesV1RunningInstancesInnerProduct instantiates a new RetrieveAllRunningInstancesV1RunningInstancesInnerProduct 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 NewRetrieveAllRunningInstancesV1RunningInstancesInnerProduct() *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct { + this := RetrieveAllRunningInstancesV1RunningInstancesInnerProduct{} + return &this +} + +// NewRetrieveAllRunningInstancesV1RunningInstancesInnerProductWithDefaults instantiates a new RetrieveAllRunningInstancesV1RunningInstancesInnerProduct 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 NewRetrieveAllRunningInstancesV1RunningInstancesInnerProductWithDefaults() *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct { + this := RetrieveAllRunningInstancesV1RunningInstancesInnerProduct{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) SetDescription(v string) { + o.Description = &v +} + +// GetGpuCount returns the GpuCount field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetGpuCount() int32 { + if o == nil || IsNil(o.GpuCount) { + var ret int32 + return ret + } + return *o.GpuCount +} + +// GetGpuCountOk returns a tuple with the GpuCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetGpuCountOk() (*int32, bool) { + if o == nil || IsNil(o.GpuCount) { + return nil, false + } + return o.GpuCount, true +} + +// HasGpuCount returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) HasGpuCount() bool { + if o != nil && !IsNil(o.GpuCount) { + return true + } + + return false +} + +// SetGpuCount gets a reference to the given int32 and assigns it to the GpuCount field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) SetGpuCount(v int32) { + o.GpuCount = &v +} + +// GetVcpu returns the Vcpu field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetVcpu() int32 { + if o == nil || IsNil(o.Vcpu) { + var ret int32 + return ret + } + return *o.Vcpu +} + +// GetVcpuOk returns a tuple with the Vcpu field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetVcpuOk() (*int32, bool) { + if o == nil || IsNil(o.Vcpu) { + return nil, false + } + return o.Vcpu, true +} + +// HasVcpu returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) HasVcpu() bool { + if o != nil && !IsNil(o.Vcpu) { + return true + } + + return false +} + +// SetVcpu gets a reference to the given int32 and assigns it to the Vcpu field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) SetVcpu(v int32) { + o.Vcpu = &v +} + +// GetRam returns the Ram field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetRam() int32 { + if o == nil || IsNil(o.Ram) { + var ret int32 + return ret + } + return *o.Ram +} + +// GetRamOk returns a tuple with the Ram field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetRamOk() (*int32, bool) { + if o == nil || IsNil(o.Ram) { + return nil, false + } + return o.Ram, true +} + +// HasRam returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) HasRam() bool { + if o != nil && !IsNil(o.Ram) { + return true + } + + return false +} + +// SetRam gets a reference to the given int32 and assigns it to the Ram field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) SetRam(v int32) { + o.Ram = &v +} + +// GetStorage returns the Storage field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetStorage() int32 { + if o == nil || IsNil(o.Storage) { + var ret int32 + return ret + } + return *o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetStorageOk() (*int32, bool) { + if o == nil || IsNil(o.Storage) { + return nil, false + } + return o.Storage, true +} + +// HasStorage returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) HasStorage() bool { + if o != nil && !IsNil(o.Storage) { + return true + } + + return false +} + +// SetStorage gets a reference to the given int32 and assigns it to the Storage field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) SetStorage(v int32) { + o.Storage = &v +} + +// GetPriceHr returns the PriceHr field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetPriceHr() string { + if o == nil || IsNil(o.PriceHr) { + var ret string + return ret + } + return *o.PriceHr +} + +// GetPriceHrOk returns a tuple with the PriceHr field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetPriceHrOk() (*string, bool) { + if o == nil || IsNil(o.PriceHr) { + return nil, false + } + return o.PriceHr, true +} + +// HasPriceHr returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) HasPriceHr() bool { + if o != nil && !IsNil(o.PriceHr) { + return true + } + + return false +} + +// SetPriceHr gets a reference to the given string and assigns it to the PriceHr field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) SetPriceHr(v string) { + o.PriceHr = &v +} + +// GetFinalPriceHr returns the FinalPriceHr field value if set, zero value otherwise. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetFinalPriceHr() string { + if o == nil || IsNil(o.FinalPriceHr) { + var ret string + return ret + } + return *o.FinalPriceHr +} + +// GetFinalPriceHrOk returns a tuple with the FinalPriceHr field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) GetFinalPriceHrOk() (*string, bool) { + if o == nil || IsNil(o.FinalPriceHr) { + return nil, false + } + return o.FinalPriceHr, true +} + +// HasFinalPriceHr returns a boolean if a field has been set. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) HasFinalPriceHr() bool { + if o != nil && !IsNil(o.FinalPriceHr) { + return true + } + + return false +} + +// SetFinalPriceHr gets a reference to the given string and assigns it to the FinalPriceHr field. +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) SetFinalPriceHr(v string) { + o.FinalPriceHr = &v +} + +func (o RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.GpuCount) { + toSerialize["gpu_count"] = o.GpuCount + } + if !IsNil(o.Vcpu) { + toSerialize["vcpu"] = o.Vcpu + } + if !IsNil(o.Ram) { + toSerialize["ram"] = o.Ram + } + if !IsNil(o.Storage) { + toSerialize["storage"] = o.Storage + } + if !IsNil(o.PriceHr) { + toSerialize["price_hr"] = o.PriceHr + } + if !IsNil(o.FinalPriceHr) { + toSerialize["final_price_hr"] = o.FinalPriceHr + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) UnmarshalJSON(data []byte) (err error) { + varRetrieveAllRunningInstancesV1RunningInstancesInnerProduct := _RetrieveAllRunningInstancesV1RunningInstancesInnerProduct{} + + err = json.Unmarshal(data, &varRetrieveAllRunningInstancesV1RunningInstancesInnerProduct) + + if err != nil { + return err + } + + *o = RetrieveAllRunningInstancesV1RunningInstancesInnerProduct(varRetrieveAllRunningInstancesV1RunningInstancesInnerProduct) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "gpu_count") + delete(additionalProperties, "vcpu") + delete(additionalProperties, "ram") + delete(additionalProperties, "storage") + delete(additionalProperties, "price_hr") + delete(additionalProperties, "final_price_hr") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRetrieveAllRunningInstancesV1RunningInstancesInnerProduct struct { + value *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct + isSet bool +} + +func (v NullableRetrieveAllRunningInstancesV1RunningInstancesInnerProduct) Get() *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct { + return v.value +} + +func (v *NullableRetrieveAllRunningInstancesV1RunningInstancesInnerProduct) Set(val *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) { + v.value = val + v.isSet = true +} + +func (v NullableRetrieveAllRunningInstancesV1RunningInstancesInnerProduct) IsSet() bool { + return v.isSet +} + +func (v *NullableRetrieveAllRunningInstancesV1RunningInstancesInnerProduct) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRetrieveAllRunningInstancesV1RunningInstancesInnerProduct(val *RetrieveAllRunningInstancesV1RunningInstancesInnerProduct) *NullableRetrieveAllRunningInstancesV1RunningInstancesInnerProduct { + return &NullableRetrieveAllRunningInstancesV1RunningInstancesInnerProduct{value: val, isSet: true} +} + +func (v NullableRetrieveAllRunningInstancesV1RunningInstancesInnerProduct) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRetrieveAllRunningInstancesV1RunningInstancesInnerProduct) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_retrieve_billing_information_v1.go b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_billing_information_v1.go new file mode 100644 index 0000000..b3ba9bc --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_billing_information_v1.go @@ -0,0 +1,301 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the RetrieveBillingInformationV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RetrieveBillingInformationV1{} + +// RetrieveBillingInformationV1 struct for RetrieveBillingInformationV1 +type RetrieveBillingInformationV1 struct { + BillingMethod *string `json:"billingMethod,omitempty"` + RechargeThresholdCents *int32 `json:"rechargeThresholdCents,omitempty"` + RechargeThreshold *string `json:"rechargeThreshold,omitempty"` + RechargeAmountCents *int32 `json:"rechargeAmountCents,omitempty"` + RechargeAmount *string `json:"rechargeAmount,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RetrieveBillingInformationV1 RetrieveBillingInformationV1 + +// NewRetrieveBillingInformationV1 instantiates a new RetrieveBillingInformationV1 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 NewRetrieveBillingInformationV1() *RetrieveBillingInformationV1 { + this := RetrieveBillingInformationV1{} + return &this +} + +// NewRetrieveBillingInformationV1WithDefaults instantiates a new RetrieveBillingInformationV1 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 NewRetrieveBillingInformationV1WithDefaults() *RetrieveBillingInformationV1 { + this := RetrieveBillingInformationV1{} + return &this +} + +// GetBillingMethod returns the BillingMethod field value if set, zero value otherwise. +func (o *RetrieveBillingInformationV1) GetBillingMethod() string { + if o == nil || IsNil(o.BillingMethod) { + var ret string + return ret + } + return *o.BillingMethod +} + +// GetBillingMethodOk returns a tuple with the BillingMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveBillingInformationV1) GetBillingMethodOk() (*string, bool) { + if o == nil || IsNil(o.BillingMethod) { + return nil, false + } + return o.BillingMethod, true +} + +// HasBillingMethod returns a boolean if a field has been set. +func (o *RetrieveBillingInformationV1) HasBillingMethod() bool { + if o != nil && !IsNil(o.BillingMethod) { + return true + } + + return false +} + +// SetBillingMethod gets a reference to the given string and assigns it to the BillingMethod field. +func (o *RetrieveBillingInformationV1) SetBillingMethod(v string) { + o.BillingMethod = &v +} + +// GetRechargeThresholdCents returns the RechargeThresholdCents field value if set, zero value otherwise. +func (o *RetrieveBillingInformationV1) GetRechargeThresholdCents() int32 { + if o == nil || IsNil(o.RechargeThresholdCents) { + var ret int32 + return ret + } + return *o.RechargeThresholdCents +} + +// GetRechargeThresholdCentsOk returns a tuple with the RechargeThresholdCents field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveBillingInformationV1) GetRechargeThresholdCentsOk() (*int32, bool) { + if o == nil || IsNil(o.RechargeThresholdCents) { + return nil, false + } + return o.RechargeThresholdCents, true +} + +// HasRechargeThresholdCents returns a boolean if a field has been set. +func (o *RetrieveBillingInformationV1) HasRechargeThresholdCents() bool { + if o != nil && !IsNil(o.RechargeThresholdCents) { + return true + } + + return false +} + +// SetRechargeThresholdCents gets a reference to the given int32 and assigns it to the RechargeThresholdCents field. +func (o *RetrieveBillingInformationV1) SetRechargeThresholdCents(v int32) { + o.RechargeThresholdCents = &v +} + +// GetRechargeThreshold returns the RechargeThreshold field value if set, zero value otherwise. +func (o *RetrieveBillingInformationV1) GetRechargeThreshold() string { + if o == nil || IsNil(o.RechargeThreshold) { + var ret string + return ret + } + return *o.RechargeThreshold +} + +// GetRechargeThresholdOk returns a tuple with the RechargeThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveBillingInformationV1) GetRechargeThresholdOk() (*string, bool) { + if o == nil || IsNil(o.RechargeThreshold) { + return nil, false + } + return o.RechargeThreshold, true +} + +// HasRechargeThreshold returns a boolean if a field has been set. +func (o *RetrieveBillingInformationV1) HasRechargeThreshold() bool { + if o != nil && !IsNil(o.RechargeThreshold) { + return true + } + + return false +} + +// SetRechargeThreshold gets a reference to the given string and assigns it to the RechargeThreshold field. +func (o *RetrieveBillingInformationV1) SetRechargeThreshold(v string) { + o.RechargeThreshold = &v +} + +// GetRechargeAmountCents returns the RechargeAmountCents field value if set, zero value otherwise. +func (o *RetrieveBillingInformationV1) GetRechargeAmountCents() int32 { + if o == nil || IsNil(o.RechargeAmountCents) { + var ret int32 + return ret + } + return *o.RechargeAmountCents +} + +// GetRechargeAmountCentsOk returns a tuple with the RechargeAmountCents field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveBillingInformationV1) GetRechargeAmountCentsOk() (*int32, bool) { + if o == nil || IsNil(o.RechargeAmountCents) { + return nil, false + } + return o.RechargeAmountCents, true +} + +// HasRechargeAmountCents returns a boolean if a field has been set. +func (o *RetrieveBillingInformationV1) HasRechargeAmountCents() bool { + if o != nil && !IsNil(o.RechargeAmountCents) { + return true + } + + return false +} + +// SetRechargeAmountCents gets a reference to the given int32 and assigns it to the RechargeAmountCents field. +func (o *RetrieveBillingInformationV1) SetRechargeAmountCents(v int32) { + o.RechargeAmountCents = &v +} + +// GetRechargeAmount returns the RechargeAmount field value if set, zero value otherwise. +func (o *RetrieveBillingInformationV1) GetRechargeAmount() string { + if o == nil || IsNil(o.RechargeAmount) { + var ret string + return ret + } + return *o.RechargeAmount +} + +// GetRechargeAmountOk returns a tuple with the RechargeAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveBillingInformationV1) GetRechargeAmountOk() (*string, bool) { + if o == nil || IsNil(o.RechargeAmount) { + return nil, false + } + return o.RechargeAmount, true +} + +// HasRechargeAmount returns a boolean if a field has been set. +func (o *RetrieveBillingInformationV1) HasRechargeAmount() bool { + if o != nil && !IsNil(o.RechargeAmount) { + return true + } + + return false +} + +// SetRechargeAmount gets a reference to the given string and assigns it to the RechargeAmount field. +func (o *RetrieveBillingInformationV1) SetRechargeAmount(v string) { + o.RechargeAmount = &v +} + +func (o RetrieveBillingInformationV1) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RetrieveBillingInformationV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BillingMethod) { + toSerialize["billingMethod"] = o.BillingMethod + } + if !IsNil(o.RechargeThresholdCents) { + toSerialize["rechargeThresholdCents"] = o.RechargeThresholdCents + } + if !IsNil(o.RechargeThreshold) { + toSerialize["rechargeThreshold"] = o.RechargeThreshold + } + if !IsNil(o.RechargeAmountCents) { + toSerialize["rechargeAmountCents"] = o.RechargeAmountCents + } + if !IsNil(o.RechargeAmount) { + toSerialize["rechargeAmount"] = o.RechargeAmount + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RetrieveBillingInformationV1) UnmarshalJSON(data []byte) (err error) { + varRetrieveBillingInformationV1 := _RetrieveBillingInformationV1{} + + err = json.Unmarshal(data, &varRetrieveBillingInformationV1) + + if err != nil { + return err + } + + *o = RetrieveBillingInformationV1(varRetrieveBillingInformationV1) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "billingMethod") + delete(additionalProperties, "rechargeThresholdCents") + delete(additionalProperties, "rechargeThreshold") + delete(additionalProperties, "rechargeAmountCents") + delete(additionalProperties, "rechargeAmount") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRetrieveBillingInformationV1 struct { + value *RetrieveBillingInformationV1 + isSet bool +} + +func (v NullableRetrieveBillingInformationV1) Get() *RetrieveBillingInformationV1 { + return v.value +} + +func (v *NullableRetrieveBillingInformationV1) Set(val *RetrieveBillingInformationV1) { + v.value = val + v.isSet = true +} + +func (v NullableRetrieveBillingInformationV1) IsSet() bool { + return v.isSet +} + +func (v *NullableRetrieveBillingInformationV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRetrieveBillingInformationV1(val *RetrieveBillingInformationV1) *NullableRetrieveBillingInformationV1 { + return &NullableRetrieveBillingInformationV1{value: val, isSet: true} +} + +func (v NullableRetrieveBillingInformationV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRetrieveBillingInformationV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_retrieve_coupon_information_v1.go b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_coupon_information_v1.go new file mode 100644 index 0000000..9f9b66d --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_coupon_information_v1.go @@ -0,0 +1,153 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the RetrieveCouponInformationV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RetrieveCouponInformationV1{} + +// RetrieveCouponInformationV1 struct for RetrieveCouponInformationV1 +type RetrieveCouponInformationV1 struct { + Coupon *RetrieveCouponInformationV1Coupon `json:"coupon,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RetrieveCouponInformationV1 RetrieveCouponInformationV1 + +// NewRetrieveCouponInformationV1 instantiates a new RetrieveCouponInformationV1 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 NewRetrieveCouponInformationV1() *RetrieveCouponInformationV1 { + this := RetrieveCouponInformationV1{} + return &this +} + +// NewRetrieveCouponInformationV1WithDefaults instantiates a new RetrieveCouponInformationV1 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 NewRetrieveCouponInformationV1WithDefaults() *RetrieveCouponInformationV1 { + this := RetrieveCouponInformationV1{} + return &this +} + +// GetCoupon returns the Coupon field value if set, zero value otherwise. +func (o *RetrieveCouponInformationV1) GetCoupon() RetrieveCouponInformationV1Coupon { + if o == nil || IsNil(o.Coupon) { + var ret RetrieveCouponInformationV1Coupon + return ret + } + return *o.Coupon +} + +// GetCouponOk returns a tuple with the Coupon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveCouponInformationV1) GetCouponOk() (*RetrieveCouponInformationV1Coupon, bool) { + if o == nil || IsNil(o.Coupon) { + return nil, false + } + return o.Coupon, true +} + +// HasCoupon returns a boolean if a field has been set. +func (o *RetrieveCouponInformationV1) HasCoupon() bool { + if o != nil && !IsNil(o.Coupon) { + return true + } + + return false +} + +// SetCoupon gets a reference to the given RetrieveCouponInformationV1Coupon and assigns it to the Coupon field. +func (o *RetrieveCouponInformationV1) SetCoupon(v RetrieveCouponInformationV1Coupon) { + o.Coupon = &v +} + +func (o RetrieveCouponInformationV1) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RetrieveCouponInformationV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Coupon) { + toSerialize["coupon"] = o.Coupon + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RetrieveCouponInformationV1) UnmarshalJSON(data []byte) (err error) { + varRetrieveCouponInformationV1 := _RetrieveCouponInformationV1{} + + err = json.Unmarshal(data, &varRetrieveCouponInformationV1) + + if err != nil { + return err + } + + *o = RetrieveCouponInformationV1(varRetrieveCouponInformationV1) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "coupon") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRetrieveCouponInformationV1 struct { + value *RetrieveCouponInformationV1 + isSet bool +} + +func (v NullableRetrieveCouponInformationV1) Get() *RetrieveCouponInformationV1 { + return v.value +} + +func (v *NullableRetrieveCouponInformationV1) Set(val *RetrieveCouponInformationV1) { + v.value = val + v.isSet = true +} + +func (v NullableRetrieveCouponInformationV1) IsSet() bool { + return v.isSet +} + +func (v *NullableRetrieveCouponInformationV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRetrieveCouponInformationV1(val *RetrieveCouponInformationV1) *NullableRetrieveCouponInformationV1 { + return &NullableRetrieveCouponInformationV1{value: val, isSet: true} +} + +func (v NullableRetrieveCouponInformationV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRetrieveCouponInformationV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_retrieve_coupon_information_v1_coupon.go b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_coupon_information_v1_coupon.go new file mode 100644 index 0000000..57b22c6 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_coupon_information_v1_coupon.go @@ -0,0 +1,227 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the RetrieveCouponInformationV1Coupon type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RetrieveCouponInformationV1Coupon{} + +// RetrieveCouponInformationV1Coupon struct for RetrieveCouponInformationV1Coupon +type RetrieveCouponInformationV1Coupon struct { + Code *string `json:"code,omitempty"` + DiscountPercent *string `json:"discountPercent,omitempty"` + DeactivationDate *string `json:"deactivationDate,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RetrieveCouponInformationV1Coupon RetrieveCouponInformationV1Coupon + +// NewRetrieveCouponInformationV1Coupon instantiates a new RetrieveCouponInformationV1Coupon 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 NewRetrieveCouponInformationV1Coupon() *RetrieveCouponInformationV1Coupon { + this := RetrieveCouponInformationV1Coupon{} + return &this +} + +// NewRetrieveCouponInformationV1CouponWithDefaults instantiates a new RetrieveCouponInformationV1Coupon 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 NewRetrieveCouponInformationV1CouponWithDefaults() *RetrieveCouponInformationV1Coupon { + this := RetrieveCouponInformationV1Coupon{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *RetrieveCouponInformationV1Coupon) 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 *RetrieveCouponInformationV1Coupon) 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 *RetrieveCouponInformationV1Coupon) 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 *RetrieveCouponInformationV1Coupon) SetCode(v string) { + o.Code = &v +} + +// GetDiscountPercent returns the DiscountPercent field value if set, zero value otherwise. +func (o *RetrieveCouponInformationV1Coupon) GetDiscountPercent() string { + if o == nil || IsNil(o.DiscountPercent) { + var ret string + return ret + } + return *o.DiscountPercent +} + +// GetDiscountPercentOk returns a tuple with the DiscountPercent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveCouponInformationV1Coupon) GetDiscountPercentOk() (*string, bool) { + if o == nil || IsNil(o.DiscountPercent) { + return nil, false + } + return o.DiscountPercent, true +} + +// HasDiscountPercent returns a boolean if a field has been set. +func (o *RetrieveCouponInformationV1Coupon) HasDiscountPercent() bool { + if o != nil && !IsNil(o.DiscountPercent) { + return true + } + + return false +} + +// SetDiscountPercent gets a reference to the given string and assigns it to the DiscountPercent field. +func (o *RetrieveCouponInformationV1Coupon) SetDiscountPercent(v string) { + o.DiscountPercent = &v +} + +// GetDeactivationDate returns the DeactivationDate field value if set, zero value otherwise. +func (o *RetrieveCouponInformationV1Coupon) GetDeactivationDate() string { + if o == nil || IsNil(o.DeactivationDate) { + var ret string + return ret + } + return *o.DeactivationDate +} + +// GetDeactivationDateOk returns a tuple with the DeactivationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveCouponInformationV1Coupon) GetDeactivationDateOk() (*string, bool) { + if o == nil || IsNil(o.DeactivationDate) { + return nil, false + } + return o.DeactivationDate, true +} + +// HasDeactivationDate returns a boolean if a field has been set. +func (o *RetrieveCouponInformationV1Coupon) HasDeactivationDate() bool { + if o != nil && !IsNil(o.DeactivationDate) { + return true + } + + return false +} + +// SetDeactivationDate gets a reference to the given string and assigns it to the DeactivationDate field. +func (o *RetrieveCouponInformationV1Coupon) SetDeactivationDate(v string) { + o.DeactivationDate = &v +} + +func (o RetrieveCouponInformationV1Coupon) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RetrieveCouponInformationV1Coupon) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.DiscountPercent) { + toSerialize["discountPercent"] = o.DiscountPercent + } + if !IsNil(o.DeactivationDate) { + toSerialize["deactivationDate"] = o.DeactivationDate + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RetrieveCouponInformationV1Coupon) UnmarshalJSON(data []byte) (err error) { + varRetrieveCouponInformationV1Coupon := _RetrieveCouponInformationV1Coupon{} + + err = json.Unmarshal(data, &varRetrieveCouponInformationV1Coupon) + + if err != nil { + return err + } + + *o = RetrieveCouponInformationV1Coupon(varRetrieveCouponInformationV1Coupon) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "code") + delete(additionalProperties, "discountPercent") + delete(additionalProperties, "deactivationDate") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRetrieveCouponInformationV1Coupon struct { + value *RetrieveCouponInformationV1Coupon + isSet bool +} + +func (v NullableRetrieveCouponInformationV1Coupon) Get() *RetrieveCouponInformationV1Coupon { + return v.value +} + +func (v *NullableRetrieveCouponInformationV1Coupon) Set(val *RetrieveCouponInformationV1Coupon) { + v.value = val + v.isSet = true +} + +func (v NullableRetrieveCouponInformationV1Coupon) IsSet() bool { + return v.isSet +} + +func (v *NullableRetrieveCouponInformationV1Coupon) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRetrieveCouponInformationV1Coupon(val *RetrieveCouponInformationV1Coupon) *NullableRetrieveCouponInformationV1Coupon { + return &NullableRetrieveCouponInformationV1Coupon{value: val, isSet: true} +} + +func (v NullableRetrieveCouponInformationV1Coupon) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRetrieveCouponInformationV1Coupon) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_retrieve_single_running_instance_v1.go b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_single_running_instance_v1.go new file mode 100644 index 0000000..dc5bc07 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_single_running_instance_v1.go @@ -0,0 +1,153 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the RetrieveSingleRunningInstanceV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RetrieveSingleRunningInstanceV1{} + +// RetrieveSingleRunningInstanceV1 struct for RetrieveSingleRunningInstanceV1 +type RetrieveSingleRunningInstanceV1 struct { + RunningInstance *RetrieveSingleRunningInstanceV1RunningInstance `json:"runningInstance,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RetrieveSingleRunningInstanceV1 RetrieveSingleRunningInstanceV1 + +// NewRetrieveSingleRunningInstanceV1 instantiates a new RetrieveSingleRunningInstanceV1 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 NewRetrieveSingleRunningInstanceV1() *RetrieveSingleRunningInstanceV1 { + this := RetrieveSingleRunningInstanceV1{} + return &this +} + +// NewRetrieveSingleRunningInstanceV1WithDefaults instantiates a new RetrieveSingleRunningInstanceV1 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 NewRetrieveSingleRunningInstanceV1WithDefaults() *RetrieveSingleRunningInstanceV1 { + this := RetrieveSingleRunningInstanceV1{} + return &this +} + +// GetRunningInstance returns the RunningInstance field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1) GetRunningInstance() RetrieveSingleRunningInstanceV1RunningInstance { + if o == nil || IsNil(o.RunningInstance) { + var ret RetrieveSingleRunningInstanceV1RunningInstance + return ret + } + return *o.RunningInstance +} + +// GetRunningInstanceOk returns a tuple with the RunningInstance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveSingleRunningInstanceV1) GetRunningInstanceOk() (*RetrieveSingleRunningInstanceV1RunningInstance, bool) { + if o == nil || IsNil(o.RunningInstance) { + return nil, false + } + return o.RunningInstance, true +} + +// HasRunningInstance returns a boolean if a field has been set. +func (o *RetrieveSingleRunningInstanceV1) HasRunningInstance() bool { + if o != nil && !IsNil(o.RunningInstance) { + return true + } + + return false +} + +// SetRunningInstance gets a reference to the given RetrieveSingleRunningInstanceV1RunningInstance and assigns it to the RunningInstance field. +func (o *RetrieveSingleRunningInstanceV1) SetRunningInstance(v RetrieveSingleRunningInstanceV1RunningInstance) { + o.RunningInstance = &v +} + +func (o RetrieveSingleRunningInstanceV1) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RetrieveSingleRunningInstanceV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.RunningInstance) { + toSerialize["runningInstance"] = o.RunningInstance + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RetrieveSingleRunningInstanceV1) UnmarshalJSON(data []byte) (err error) { + varRetrieveSingleRunningInstanceV1 := _RetrieveSingleRunningInstanceV1{} + + err = json.Unmarshal(data, &varRetrieveSingleRunningInstanceV1) + + if err != nil { + return err + } + + *o = RetrieveSingleRunningInstanceV1(varRetrieveSingleRunningInstanceV1) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "runningInstance") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRetrieveSingleRunningInstanceV1 struct { + value *RetrieveSingleRunningInstanceV1 + isSet bool +} + +func (v NullableRetrieveSingleRunningInstanceV1) Get() *RetrieveSingleRunningInstanceV1 { + return v.value +} + +func (v *NullableRetrieveSingleRunningInstanceV1) Set(val *RetrieveSingleRunningInstanceV1) { + v.value = val + v.isSet = true +} + +func (v NullableRetrieveSingleRunningInstanceV1) IsSet() bool { + return v.isSet +} + +func (v *NullableRetrieveSingleRunningInstanceV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRetrieveSingleRunningInstanceV1(val *RetrieveSingleRunningInstanceV1) *NullableRetrieveSingleRunningInstanceV1 { + return &NullableRetrieveSingleRunningInstanceV1{value: val, isSet: true} +} + +func (v NullableRetrieveSingleRunningInstanceV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRetrieveSingleRunningInstanceV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_retrieve_single_running_instance_v1_running_instance.go b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_single_running_instance_v1_running_instance.go new file mode 100644 index 0000000..d1b8efd --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_single_running_instance_v1_running_instance.go @@ -0,0 +1,560 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the RetrieveSingleRunningInstanceV1RunningInstance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RetrieveSingleRunningInstanceV1RunningInstance{} + +// RetrieveSingleRunningInstanceV1RunningInstance struct for RetrieveSingleRunningInstanceV1RunningInstance +type RetrieveSingleRunningInstanceV1RunningInstance struct { + Uuid *string `json:"uuid,omitempty"` + Name *string `json:"name,omitempty"` + Ip *string `json:"ip,omitempty"` + Username *string `json:"username,omitempty"` + Password *string `json:"password,omitempty"` + Status *string `json:"status,omitempty"` + OsBooted *int32 `json:"os_booted,omitempty"` + CommandStartup *string `json:"command_startup,omitempty"` + Created *string `json:"created,omitempty"` + Active *int32 `json:"active,omitempty"` + Image *RetrieveAllRunningInstancesV1RunningInstancesInnerImage `json:"image,omitempty"` + Product *RetrieveSingleRunningInstanceV1RunningInstanceProduct `json:"product,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RetrieveSingleRunningInstanceV1RunningInstance RetrieveSingleRunningInstanceV1RunningInstance + +// NewRetrieveSingleRunningInstanceV1RunningInstance instantiates a new RetrieveSingleRunningInstanceV1RunningInstance 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 NewRetrieveSingleRunningInstanceV1RunningInstance() *RetrieveSingleRunningInstanceV1RunningInstance { + this := RetrieveSingleRunningInstanceV1RunningInstance{} + return &this +} + +// NewRetrieveSingleRunningInstanceV1RunningInstanceWithDefaults instantiates a new RetrieveSingleRunningInstanceV1RunningInstance 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 NewRetrieveSingleRunningInstanceV1RunningInstanceWithDefaults() *RetrieveSingleRunningInstanceV1RunningInstance { + this := RetrieveSingleRunningInstanceV1RunningInstance{} + return &this +} + +// GetUuid returns the Uuid field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetUuid() string { + if o == nil || IsNil(o.Uuid) { + var ret string + return ret + } + return *o.Uuid +} + +// GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetUuidOk() (*string, bool) { + if o == nil || IsNil(o.Uuid) { + return nil, false + } + return o.Uuid, true +} + +// HasUuid returns a boolean if a field has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasUuid() bool { + if o != nil && !IsNil(o.Uuid) { + return true + } + + return false +} + +// SetUuid gets a reference to the given string and assigns it to the Uuid field. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetUuid(v string) { + o.Uuid = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetName(v string) { + o.Name = &v +} + +// GetIp returns the Ip field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetIp() string { + if o == nil || IsNil(o.Ip) { + var ret string + return ret + } + return *o.Ip +} + +// GetIpOk returns a tuple with the Ip field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetIpOk() (*string, bool) { + if o == nil || IsNil(o.Ip) { + return nil, false + } + return o.Ip, true +} + +// HasIp returns a boolean if a field has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasIp() bool { + if o != nil && !IsNil(o.Ip) { + return true + } + + return false +} + +// SetIp gets a reference to the given string and assigns it to the Ip field. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetIp(v string) { + o.Ip = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetUsername(v string) { + o.Username = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) 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 *RetrieveSingleRunningInstanceV1RunningInstance) 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 *RetrieveSingleRunningInstanceV1RunningInstance) 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 *RetrieveSingleRunningInstanceV1RunningInstance) SetPassword(v string) { + o.Password = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetStatus(v string) { + o.Status = &v +} + +// GetOsBooted returns the OsBooted field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetOsBooted() int32 { + if o == nil || IsNil(o.OsBooted) { + var ret int32 + return ret + } + return *o.OsBooted +} + +// GetOsBootedOk returns a tuple with the OsBooted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetOsBootedOk() (*int32, bool) { + if o == nil || IsNil(o.OsBooted) { + return nil, false + } + return o.OsBooted, true +} + +// HasOsBooted returns a boolean if a field has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasOsBooted() bool { + if o != nil && !IsNil(o.OsBooted) { + return true + } + + return false +} + +// SetOsBooted gets a reference to the given int32 and assigns it to the OsBooted field. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetOsBooted(v int32) { + o.OsBooted = &v +} + +// GetCommandStartup returns the CommandStartup field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetCommandStartup() string { + if o == nil || IsNil(o.CommandStartup) { + var ret string + return ret + } + return *o.CommandStartup +} + +// GetCommandStartupOk returns a tuple with the CommandStartup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetCommandStartupOk() (*string, bool) { + if o == nil || IsNil(o.CommandStartup) { + return nil, false + } + return o.CommandStartup, true +} + +// HasCommandStartup returns a boolean if a field has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasCommandStartup() bool { + if o != nil && !IsNil(o.CommandStartup) { + return true + } + + return false +} + +// SetCommandStartup gets a reference to the given string and assigns it to the CommandStartup field. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetCommandStartup(v string) { + o.CommandStartup = &v +} + +// GetCreated returns the Created field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetCreated() string { + if o == nil || IsNil(o.Created) { + var ret string + return ret + } + return *o.Created +} + +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetCreatedOk() (*string, bool) { + if o == nil || IsNil(o.Created) { + return nil, false + } + return o.Created, true +} + +// HasCreated returns a boolean if a field has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasCreated() bool { + if o != nil && !IsNil(o.Created) { + return true + } + + return false +} + +// SetCreated gets a reference to the given string and assigns it to the Created field. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetCreated(v string) { + o.Created = &v +} + +// GetActive returns the Active field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetActive() int32 { + if o == nil || IsNil(o.Active) { + var ret int32 + 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 *RetrieveSingleRunningInstanceV1RunningInstance) GetActiveOk() (*int32, 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 *RetrieveSingleRunningInstanceV1RunningInstance) HasActive() bool { + if o != nil && !IsNil(o.Active) { + return true + } + + return false +} + +// SetActive gets a reference to the given int32 and assigns it to the Active field. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetActive(v int32) { + o.Active = &v +} + +// GetImage returns the Image field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetImage() RetrieveAllRunningInstancesV1RunningInstancesInnerImage { + if o == nil || IsNil(o.Image) { + var ret RetrieveAllRunningInstancesV1RunningInstancesInnerImage + return ret + } + return *o.Image +} + +// GetImageOk returns a tuple with the Image field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetImageOk() (*RetrieveAllRunningInstancesV1RunningInstancesInnerImage, bool) { + if o == nil || IsNil(o.Image) { + return nil, false + } + return o.Image, true +} + +// HasImage returns a boolean if a field has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasImage() bool { + if o != nil && !IsNil(o.Image) { + return true + } + + return false +} + +// SetImage gets a reference to the given RetrieveAllRunningInstancesV1RunningInstancesInnerImage and assigns it to the Image field. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetImage(v RetrieveAllRunningInstancesV1RunningInstancesInnerImage) { + o.Image = &v +} + +// GetProduct returns the Product field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetProduct() RetrieveSingleRunningInstanceV1RunningInstanceProduct { + if o == nil || IsNil(o.Product) { + var ret RetrieveSingleRunningInstanceV1RunningInstanceProduct + return ret + } + return *o.Product +} + +// GetProductOk returns a tuple with the Product field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) GetProductOk() (*RetrieveSingleRunningInstanceV1RunningInstanceProduct, bool) { + if o == nil || IsNil(o.Product) { + return nil, false + } + return o.Product, true +} + +// HasProduct returns a boolean if a field has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) HasProduct() bool { + if o != nil && !IsNil(o.Product) { + return true + } + + return false +} + +// SetProduct gets a reference to the given RetrieveSingleRunningInstanceV1RunningInstanceProduct and assigns it to the Product field. +func (o *RetrieveSingleRunningInstanceV1RunningInstance) SetProduct(v RetrieveSingleRunningInstanceV1RunningInstanceProduct) { + o.Product = &v +} + +func (o RetrieveSingleRunningInstanceV1RunningInstance) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RetrieveSingleRunningInstanceV1RunningInstance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Uuid) { + toSerialize["uuid"] = o.Uuid + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Ip) { + toSerialize["ip"] = o.Ip + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + if !IsNil(o.Password) { + toSerialize["password"] = o.Password + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.OsBooted) { + toSerialize["os_booted"] = o.OsBooted + } + if !IsNil(o.CommandStartup) { + toSerialize["command_startup"] = o.CommandStartup + } + if !IsNil(o.Created) { + toSerialize["created"] = o.Created + } + if !IsNil(o.Active) { + toSerialize["active"] = o.Active + } + if !IsNil(o.Image) { + toSerialize["image"] = o.Image + } + if !IsNil(o.Product) { + toSerialize["product"] = o.Product + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RetrieveSingleRunningInstanceV1RunningInstance) UnmarshalJSON(data []byte) (err error) { + varRetrieveSingleRunningInstanceV1RunningInstance := _RetrieveSingleRunningInstanceV1RunningInstance{} + + err = json.Unmarshal(data, &varRetrieveSingleRunningInstanceV1RunningInstance) + + if err != nil { + return err + } + + *o = RetrieveSingleRunningInstanceV1RunningInstance(varRetrieveSingleRunningInstanceV1RunningInstance) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "uuid") + delete(additionalProperties, "name") + delete(additionalProperties, "ip") + delete(additionalProperties, "username") + delete(additionalProperties, "password") + delete(additionalProperties, "status") + delete(additionalProperties, "os_booted") + delete(additionalProperties, "command_startup") + delete(additionalProperties, "created") + delete(additionalProperties, "active") + delete(additionalProperties, "image") + delete(additionalProperties, "product") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRetrieveSingleRunningInstanceV1RunningInstance struct { + value *RetrieveSingleRunningInstanceV1RunningInstance + isSet bool +} + +func (v NullableRetrieveSingleRunningInstanceV1RunningInstance) Get() *RetrieveSingleRunningInstanceV1RunningInstance { + return v.value +} + +func (v *NullableRetrieveSingleRunningInstanceV1RunningInstance) Set(val *RetrieveSingleRunningInstanceV1RunningInstance) { + v.value = val + v.isSet = true +} + +func (v NullableRetrieveSingleRunningInstanceV1RunningInstance) IsSet() bool { + return v.isSet +} + +func (v *NullableRetrieveSingleRunningInstanceV1RunningInstance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRetrieveSingleRunningInstanceV1RunningInstance(val *RetrieveSingleRunningInstanceV1RunningInstance) *NullableRetrieveSingleRunningInstanceV1RunningInstance { + return &NullableRetrieveSingleRunningInstanceV1RunningInstance{value: val, isSet: true} +} + +func (v NullableRetrieveSingleRunningInstanceV1RunningInstance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRetrieveSingleRunningInstanceV1RunningInstance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_retrieve_single_running_instance_v1_running_instance_product.go b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_single_running_instance_v1_running_instance_product.go new file mode 100644 index 0000000..3992f65 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_retrieve_single_running_instance_v1_running_instance_product.go @@ -0,0 +1,412 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the RetrieveSingleRunningInstanceV1RunningInstanceProduct type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RetrieveSingleRunningInstanceV1RunningInstanceProduct{} + +// RetrieveSingleRunningInstanceV1RunningInstanceProduct struct for RetrieveSingleRunningInstanceV1RunningInstanceProduct +type RetrieveSingleRunningInstanceV1RunningInstanceProduct struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + GpuCount *int32 `json:"gpu_count,omitempty"` + Vcpu *int32 `json:"vcpu,omitempty"` + Ram *int32 `json:"ram,omitempty"` + Storage *int32 `json:"storage,omitempty"` + PriceHr *string `json:"price_hr,omitempty"` + FinalPriceHr *string `json:"final_price_hr,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RetrieveSingleRunningInstanceV1RunningInstanceProduct RetrieveSingleRunningInstanceV1RunningInstanceProduct + +// NewRetrieveSingleRunningInstanceV1RunningInstanceProduct instantiates a new RetrieveSingleRunningInstanceV1RunningInstanceProduct 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 NewRetrieveSingleRunningInstanceV1RunningInstanceProduct() *RetrieveSingleRunningInstanceV1RunningInstanceProduct { + this := RetrieveSingleRunningInstanceV1RunningInstanceProduct{} + return &this +} + +// NewRetrieveSingleRunningInstanceV1RunningInstanceProductWithDefaults instantiates a new RetrieveSingleRunningInstanceV1RunningInstanceProduct 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 NewRetrieveSingleRunningInstanceV1RunningInstanceProductWithDefaults() *RetrieveSingleRunningInstanceV1RunningInstanceProduct { + this := RetrieveSingleRunningInstanceV1RunningInstanceProduct{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) SetDescription(v string) { + o.Description = &v +} + +// GetGpuCount returns the GpuCount field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetGpuCount() int32 { + if o == nil || IsNil(o.GpuCount) { + var ret int32 + return ret + } + return *o.GpuCount +} + +// GetGpuCountOk returns a tuple with the GpuCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetGpuCountOk() (*int32, bool) { + if o == nil || IsNil(o.GpuCount) { + return nil, false + } + return o.GpuCount, true +} + +// HasGpuCount returns a boolean if a field has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) HasGpuCount() bool { + if o != nil && !IsNil(o.GpuCount) { + return true + } + + return false +} + +// SetGpuCount gets a reference to the given int32 and assigns it to the GpuCount field. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) SetGpuCount(v int32) { + o.GpuCount = &v +} + +// GetVcpu returns the Vcpu field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetVcpu() int32 { + if o == nil || IsNil(o.Vcpu) { + var ret int32 + return ret + } + return *o.Vcpu +} + +// GetVcpuOk returns a tuple with the Vcpu field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetVcpuOk() (*int32, bool) { + if o == nil || IsNil(o.Vcpu) { + return nil, false + } + return o.Vcpu, true +} + +// HasVcpu returns a boolean if a field has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) HasVcpu() bool { + if o != nil && !IsNil(o.Vcpu) { + return true + } + + return false +} + +// SetVcpu gets a reference to the given int32 and assigns it to the Vcpu field. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) SetVcpu(v int32) { + o.Vcpu = &v +} + +// GetRam returns the Ram field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetRam() int32 { + if o == nil || IsNil(o.Ram) { + var ret int32 + return ret + } + return *o.Ram +} + +// GetRamOk returns a tuple with the Ram field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetRamOk() (*int32, bool) { + if o == nil || IsNil(o.Ram) { + return nil, false + } + return o.Ram, true +} + +// HasRam returns a boolean if a field has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) HasRam() bool { + if o != nil && !IsNil(o.Ram) { + return true + } + + return false +} + +// SetRam gets a reference to the given int32 and assigns it to the Ram field. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) SetRam(v int32) { + o.Ram = &v +} + +// GetStorage returns the Storage field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetStorage() int32 { + if o == nil || IsNil(o.Storage) { + var ret int32 + return ret + } + return *o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetStorageOk() (*int32, bool) { + if o == nil || IsNil(o.Storage) { + return nil, false + } + return o.Storage, true +} + +// HasStorage returns a boolean if a field has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) HasStorage() bool { + if o != nil && !IsNil(o.Storage) { + return true + } + + return false +} + +// SetStorage gets a reference to the given int32 and assigns it to the Storage field. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) SetStorage(v int32) { + o.Storage = &v +} + +// GetPriceHr returns the PriceHr field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetPriceHr() string { + if o == nil || IsNil(o.PriceHr) { + var ret string + return ret + } + return *o.PriceHr +} + +// GetPriceHrOk returns a tuple with the PriceHr field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetPriceHrOk() (*string, bool) { + if o == nil || IsNil(o.PriceHr) { + return nil, false + } + return o.PriceHr, true +} + +// HasPriceHr returns a boolean if a field has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) HasPriceHr() bool { + if o != nil && !IsNil(o.PriceHr) { + return true + } + + return false +} + +// SetPriceHr gets a reference to the given string and assigns it to the PriceHr field. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) SetPriceHr(v string) { + o.PriceHr = &v +} + +// GetFinalPriceHr returns the FinalPriceHr field value if set, zero value otherwise. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetFinalPriceHr() string { + if o == nil || IsNil(o.FinalPriceHr) { + var ret string + return ret + } + return *o.FinalPriceHr +} + +// GetFinalPriceHrOk returns a tuple with the FinalPriceHr field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) GetFinalPriceHrOk() (*string, bool) { + if o == nil || IsNil(o.FinalPriceHr) { + return nil, false + } + return o.FinalPriceHr, true +} + +// HasFinalPriceHr returns a boolean if a field has been set. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) HasFinalPriceHr() bool { + if o != nil && !IsNil(o.FinalPriceHr) { + return true + } + + return false +} + +// SetFinalPriceHr gets a reference to the given string and assigns it to the FinalPriceHr field. +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) SetFinalPriceHr(v string) { + o.FinalPriceHr = &v +} + +func (o RetrieveSingleRunningInstanceV1RunningInstanceProduct) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RetrieveSingleRunningInstanceV1RunningInstanceProduct) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.GpuCount) { + toSerialize["gpu_count"] = o.GpuCount + } + if !IsNil(o.Vcpu) { + toSerialize["vcpu"] = o.Vcpu + } + if !IsNil(o.Ram) { + toSerialize["ram"] = o.Ram + } + if !IsNil(o.Storage) { + toSerialize["storage"] = o.Storage + } + if !IsNil(o.PriceHr) { + toSerialize["price_hr"] = o.PriceHr + } + if !IsNil(o.FinalPriceHr) { + toSerialize["final_price_hr"] = o.FinalPriceHr + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RetrieveSingleRunningInstanceV1RunningInstanceProduct) UnmarshalJSON(data []byte) (err error) { + varRetrieveSingleRunningInstanceV1RunningInstanceProduct := _RetrieveSingleRunningInstanceV1RunningInstanceProduct{} + + err = json.Unmarshal(data, &varRetrieveSingleRunningInstanceV1RunningInstanceProduct) + + if err != nil { + return err + } + + *o = RetrieveSingleRunningInstanceV1RunningInstanceProduct(varRetrieveSingleRunningInstanceV1RunningInstanceProduct) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "gpu_count") + delete(additionalProperties, "vcpu") + delete(additionalProperties, "ram") + delete(additionalProperties, "storage") + delete(additionalProperties, "price_hr") + delete(additionalProperties, "final_price_hr") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRetrieveSingleRunningInstanceV1RunningInstanceProduct struct { + value *RetrieveSingleRunningInstanceV1RunningInstanceProduct + isSet bool +} + +func (v NullableRetrieveSingleRunningInstanceV1RunningInstanceProduct) Get() *RetrieveSingleRunningInstanceV1RunningInstanceProduct { + return v.value +} + +func (v *NullableRetrieveSingleRunningInstanceV1RunningInstanceProduct) Set(val *RetrieveSingleRunningInstanceV1RunningInstanceProduct) { + v.value = val + v.isSet = true +} + +func (v NullableRetrieveSingleRunningInstanceV1RunningInstanceProduct) IsSet() bool { + return v.isSet +} + +func (v *NullableRetrieveSingleRunningInstanceV1RunningInstanceProduct) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRetrieveSingleRunningInstanceV1RunningInstanceProduct(val *RetrieveSingleRunningInstanceV1RunningInstanceProduct) *NullableRetrieveSingleRunningInstanceV1RunningInstanceProduct { + return &NullableRetrieveSingleRunningInstanceV1RunningInstanceProduct{value: val, isSet: true} +} + +func (v NullableRetrieveSingleRunningInstanceV1RunningInstanceProduct) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRetrieveSingleRunningInstanceV1RunningInstanceProduct) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_ssh_key.go b/v1/providers/massedcompute/gen/massedcompute/model_ssh_key.go new file mode 100644 index 0000000..83bbeb9 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_ssh_key.go @@ -0,0 +1,153 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the SSHKey type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SSHKey{} + +// SSHKey struct for SSHKey +type SSHKey struct { + SshKeys []SSHKeyItem `json:"sshKeys,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SSHKey SSHKey + +// NewSSHKey instantiates a new SSHKey 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 NewSSHKey() *SSHKey { + this := SSHKey{} + return &this +} + +// NewSSHKeyWithDefaults instantiates a new SSHKey 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 NewSSHKeyWithDefaults() *SSHKey { + this := SSHKey{} + return &this +} + +// GetSshKeys returns the SshKeys field value if set, zero value otherwise. +func (o *SSHKey) GetSshKeys() []SSHKeyItem { + if o == nil || IsNil(o.SshKeys) { + var ret []SSHKeyItem + return ret + } + return o.SshKeys +} + +// GetSshKeysOk returns a tuple with the SshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSHKey) GetSshKeysOk() ([]SSHKeyItem, bool) { + if o == nil || IsNil(o.SshKeys) { + return nil, false + } + return o.SshKeys, true +} + +// HasSshKeys returns a boolean if a field has been set. +func (o *SSHKey) HasSshKeys() bool { + if o != nil && !IsNil(o.SshKeys) { + return true + } + + return false +} + +// SetSshKeys gets a reference to the given []SSHKeyItem and assigns it to the SshKeys field. +func (o *SSHKey) SetSshKeys(v []SSHKeyItem) { + o.SshKeys = v +} + +func (o SSHKey) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SSHKey) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.SshKeys) { + toSerialize["sshKeys"] = o.SshKeys + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SSHKey) UnmarshalJSON(data []byte) (err error) { + varSSHKey := _SSHKey{} + + err = json.Unmarshal(data, &varSSHKey) + + if err != nil { + return err + } + + *o = SSHKey(varSSHKey) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "sshKeys") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSSHKey struct { + value *SSHKey + isSet bool +} + +func (v NullableSSHKey) Get() *SSHKey { + return v.value +} + +func (v *NullableSSHKey) Set(val *SSHKey) { + v.value = val + v.isSet = true +} + +func (v NullableSSHKey) IsSet() bool { + return v.isSet +} + +func (v *NullableSSHKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSSHKey(val *SSHKey) *NullableSSHKey { + return &NullableSSHKey{value: val, isSet: true} +} + +func (v NullableSSHKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSSHKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_ssh_key_item.go b/v1/providers/massedcompute/gen/massedcompute/model_ssh_key_item.go new file mode 100644 index 0000000..b07d306 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_ssh_key_item.go @@ -0,0 +1,230 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the SSHKeyItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SSHKeyItem{} + +// SSHKeyItem struct for SSHKeyItem +type SSHKeyItem struct { + // The unique identifier for the SSH key + Id *string `json:"id,omitempty"` + // The name of the SSH key + Name *string `json:"name,omitempty"` + // The public key associated with the SSH key + PublicKey *string `json:"public_key,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SSHKeyItem SSHKeyItem + +// NewSSHKeyItem instantiates a new SSHKeyItem 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 NewSSHKeyItem() *SSHKeyItem { + this := SSHKeyItem{} + return &this +} + +// NewSSHKeyItemWithDefaults instantiates a new SSHKeyItem 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 NewSSHKeyItemWithDefaults() *SSHKeyItem { + this := SSHKeyItem{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SSHKeyItem) 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 *SSHKeyItem) 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 *SSHKeyItem) 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 *SSHKeyItem) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SSHKeyItem) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSHKeyItem) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SSHKeyItem) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SSHKeyItem) SetName(v string) { + o.Name = &v +} + +// GetPublicKey returns the PublicKey field value if set, zero value otherwise. +func (o *SSHKeyItem) 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 *SSHKeyItem) 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 *SSHKeyItem) 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 *SSHKeyItem) SetPublicKey(v string) { + o.PublicKey = &v +} + +func (o SSHKeyItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SSHKeyItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PublicKey) { + toSerialize["public_key"] = o.PublicKey + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SSHKeyItem) UnmarshalJSON(data []byte) (err error) { + varSSHKeyItem := _SSHKeyItem{} + + err = json.Unmarshal(data, &varSSHKeyItem) + + if err != nil { + return err + } + + *o = SSHKeyItem(varSSHKeyItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "public_key") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSSHKeyItem struct { + value *SSHKeyItem + isSet bool +} + +func (v NullableSSHKeyItem) Get() *SSHKeyItem { + return v.value +} + +func (v *NullableSSHKeyItem) Set(val *SSHKeyItem) { + v.value = val + v.isSet = true +} + +func (v NullableSSHKeyItem) IsSet() bool { + return v.isSet +} + +func (v *NullableSSHKeyItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSSHKeyItem(val *SSHKeyItem) *NullableSSHKeyItem { + return &NullableSSHKeyItem{value: val, isSet: true} +} + +func (v NullableSSHKeyItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSSHKeyItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_terminate_instance_v1.go b/v1/providers/massedcompute/gen/massedcompute/model_terminate_instance_v1.go new file mode 100644 index 0000000..898bbf6 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_terminate_instance_v1.go @@ -0,0 +1,153 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the TerminateInstanceV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TerminateInstanceV1{} + +// TerminateInstanceV1 struct for TerminateInstanceV1 +type TerminateInstanceV1 struct { + Response *TerminateInstanceV1Response `json:"response,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TerminateInstanceV1 TerminateInstanceV1 + +// NewTerminateInstanceV1 instantiates a new TerminateInstanceV1 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 NewTerminateInstanceV1() *TerminateInstanceV1 { + this := TerminateInstanceV1{} + return &this +} + +// NewTerminateInstanceV1WithDefaults instantiates a new TerminateInstanceV1 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 NewTerminateInstanceV1WithDefaults() *TerminateInstanceV1 { + this := TerminateInstanceV1{} + return &this +} + +// GetResponse returns the Response field value if set, zero value otherwise. +func (o *TerminateInstanceV1) GetResponse() TerminateInstanceV1Response { + if o == nil || IsNil(o.Response) { + var ret TerminateInstanceV1Response + return ret + } + return *o.Response +} + +// GetResponseOk returns a tuple with the Response field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TerminateInstanceV1) GetResponseOk() (*TerminateInstanceV1Response, bool) { + if o == nil || IsNil(o.Response) { + return nil, false + } + return o.Response, true +} + +// HasResponse returns a boolean if a field has been set. +func (o *TerminateInstanceV1) HasResponse() bool { + if o != nil && !IsNil(o.Response) { + return true + } + + return false +} + +// SetResponse gets a reference to the given TerminateInstanceV1Response and assigns it to the Response field. +func (o *TerminateInstanceV1) SetResponse(v TerminateInstanceV1Response) { + o.Response = &v +} + +func (o TerminateInstanceV1) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TerminateInstanceV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Response) { + toSerialize["response"] = o.Response + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TerminateInstanceV1) UnmarshalJSON(data []byte) (err error) { + varTerminateInstanceV1 := _TerminateInstanceV1{} + + err = json.Unmarshal(data, &varTerminateInstanceV1) + + if err != nil { + return err + } + + *o = TerminateInstanceV1(varTerminateInstanceV1) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "response") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTerminateInstanceV1 struct { + value *TerminateInstanceV1 + isSet bool +} + +func (v NullableTerminateInstanceV1) Get() *TerminateInstanceV1 { + return v.value +} + +func (v *NullableTerminateInstanceV1) Set(val *TerminateInstanceV1) { + v.value = val + v.isSet = true +} + +func (v NullableTerminateInstanceV1) IsSet() bool { + return v.isSet +} + +func (v *NullableTerminateInstanceV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTerminateInstanceV1(val *TerminateInstanceV1) *NullableTerminateInstanceV1 { + return &NullableTerminateInstanceV1{value: val, isSet: true} +} + +func (v NullableTerminateInstanceV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTerminateInstanceV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_terminate_instance_v1_response.go b/v1/providers/massedcompute/gen/massedcompute/model_terminate_instance_v1_response.go new file mode 100644 index 0000000..381df2a --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_terminate_instance_v1_response.go @@ -0,0 +1,153 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the TerminateInstanceV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TerminateInstanceV1Response{} + +// TerminateInstanceV1Response struct for TerminateInstanceV1Response +type TerminateInstanceV1Response struct { + Data *TerminateInstanceV1ResponseData `json:"data,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TerminateInstanceV1Response TerminateInstanceV1Response + +// NewTerminateInstanceV1Response instantiates a new TerminateInstanceV1Response 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 NewTerminateInstanceV1Response() *TerminateInstanceV1Response { + this := TerminateInstanceV1Response{} + return &this +} + +// NewTerminateInstanceV1ResponseWithDefaults instantiates a new TerminateInstanceV1Response 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 NewTerminateInstanceV1ResponseWithDefaults() *TerminateInstanceV1Response { + this := TerminateInstanceV1Response{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *TerminateInstanceV1Response) GetData() TerminateInstanceV1ResponseData { + if o == nil || IsNil(o.Data) { + var ret TerminateInstanceV1ResponseData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TerminateInstanceV1Response) GetDataOk() (*TerminateInstanceV1ResponseData, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *TerminateInstanceV1Response) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given TerminateInstanceV1ResponseData and assigns it to the Data field. +func (o *TerminateInstanceV1Response) SetData(v TerminateInstanceV1ResponseData) { + o.Data = &v +} + +func (o TerminateInstanceV1Response) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TerminateInstanceV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TerminateInstanceV1Response) UnmarshalJSON(data []byte) (err error) { + varTerminateInstanceV1Response := _TerminateInstanceV1Response{} + + err = json.Unmarshal(data, &varTerminateInstanceV1Response) + + if err != nil { + return err + } + + *o = TerminateInstanceV1Response(varTerminateInstanceV1Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "data") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTerminateInstanceV1Response struct { + value *TerminateInstanceV1Response + isSet bool +} + +func (v NullableTerminateInstanceV1Response) Get() *TerminateInstanceV1Response { + return v.value +} + +func (v *NullableTerminateInstanceV1Response) Set(val *TerminateInstanceV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableTerminateInstanceV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableTerminateInstanceV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTerminateInstanceV1Response(val *TerminateInstanceV1Response) *NullableTerminateInstanceV1Response { + return &NullableTerminateInstanceV1Response{value: val, isSet: true} +} + +func (v NullableTerminateInstanceV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTerminateInstanceV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_terminate_instance_v1_response_data.go b/v1/providers/massedcompute/gen/massedcompute/model_terminate_instance_v1_response_data.go new file mode 100644 index 0000000..1dd570e --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_terminate_instance_v1_response_data.go @@ -0,0 +1,153 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the TerminateInstanceV1ResponseData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TerminateInstanceV1ResponseData{} + +// TerminateInstanceV1ResponseData struct for TerminateInstanceV1ResponseData +type TerminateInstanceV1ResponseData struct { + TerminatedInstances []TerminateInstanceV1ResponseDataTerminatedInstancesInner `json:"terminated_instances,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TerminateInstanceV1ResponseData TerminateInstanceV1ResponseData + +// NewTerminateInstanceV1ResponseData instantiates a new TerminateInstanceV1ResponseData 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 NewTerminateInstanceV1ResponseData() *TerminateInstanceV1ResponseData { + this := TerminateInstanceV1ResponseData{} + return &this +} + +// NewTerminateInstanceV1ResponseDataWithDefaults instantiates a new TerminateInstanceV1ResponseData 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 NewTerminateInstanceV1ResponseDataWithDefaults() *TerminateInstanceV1ResponseData { + this := TerminateInstanceV1ResponseData{} + return &this +} + +// GetTerminatedInstances returns the TerminatedInstances field value if set, zero value otherwise. +func (o *TerminateInstanceV1ResponseData) GetTerminatedInstances() []TerminateInstanceV1ResponseDataTerminatedInstancesInner { + if o == nil || IsNil(o.TerminatedInstances) { + var ret []TerminateInstanceV1ResponseDataTerminatedInstancesInner + return ret + } + return o.TerminatedInstances +} + +// GetTerminatedInstancesOk returns a tuple with the TerminatedInstances field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TerminateInstanceV1ResponseData) GetTerminatedInstancesOk() ([]TerminateInstanceV1ResponseDataTerminatedInstancesInner, bool) { + if o == nil || IsNil(o.TerminatedInstances) { + return nil, false + } + return o.TerminatedInstances, true +} + +// HasTerminatedInstances returns a boolean if a field has been set. +func (o *TerminateInstanceV1ResponseData) HasTerminatedInstances() bool { + if o != nil && !IsNil(o.TerminatedInstances) { + return true + } + + return false +} + +// SetTerminatedInstances gets a reference to the given []TerminateInstanceV1ResponseDataTerminatedInstancesInner and assigns it to the TerminatedInstances field. +func (o *TerminateInstanceV1ResponseData) SetTerminatedInstances(v []TerminateInstanceV1ResponseDataTerminatedInstancesInner) { + o.TerminatedInstances = v +} + +func (o TerminateInstanceV1ResponseData) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TerminateInstanceV1ResponseData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TerminatedInstances) { + toSerialize["terminated_instances"] = o.TerminatedInstances + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TerminateInstanceV1ResponseData) UnmarshalJSON(data []byte) (err error) { + varTerminateInstanceV1ResponseData := _TerminateInstanceV1ResponseData{} + + err = json.Unmarshal(data, &varTerminateInstanceV1ResponseData) + + if err != nil { + return err + } + + *o = TerminateInstanceV1ResponseData(varTerminateInstanceV1ResponseData) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "terminated_instances") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTerminateInstanceV1ResponseData struct { + value *TerminateInstanceV1ResponseData + isSet bool +} + +func (v NullableTerminateInstanceV1ResponseData) Get() *TerminateInstanceV1ResponseData { + return v.value +} + +func (v *NullableTerminateInstanceV1ResponseData) Set(val *TerminateInstanceV1ResponseData) { + v.value = val + v.isSet = true +} + +func (v NullableTerminateInstanceV1ResponseData) IsSet() bool { + return v.isSet +} + +func (v *NullableTerminateInstanceV1ResponseData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTerminateInstanceV1ResponseData(val *TerminateInstanceV1ResponseData) *NullableTerminateInstanceV1ResponseData { + return &NullableTerminateInstanceV1ResponseData{value: val, isSet: true} +} + +func (v NullableTerminateInstanceV1ResponseData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTerminateInstanceV1ResponseData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/model_terminate_instance_v1_response_data_terminated_instances_inner.go b/v1/providers/massedcompute/gen/massedcompute/model_terminate_instance_v1_response_data_terminated_instances_inner.go new file mode 100644 index 0000000..849fc60 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/model_terminate_instance_v1_response_data_terminated_instances_inner.go @@ -0,0 +1,486 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the TerminateInstanceV1ResponseDataTerminatedInstancesInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TerminateInstanceV1ResponseDataTerminatedInstancesInner{} + +// TerminateInstanceV1ResponseDataTerminatedInstancesInner struct for TerminateInstanceV1ResponseDataTerminatedInstancesInner +type TerminateInstanceV1ResponseDataTerminatedInstancesInner struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Ip *string `json:"ip,omitempty"` + Status *string `json:"status,omitempty"` + SshKeyNames []string `json:"ssh_key_names,omitempty"` + FileSystemNames []string `json:"file_system_names,omitempty"` + Region *RestartInstanceV1ResponseInnerRegion `json:"region,omitempty"` + InstanceType *RestartInstanceV1ResponseInnerInstanceType `json:"instance_type,omitempty"` + JupyterToken *string `json:"jupyter_token,omitempty"` + JupyterUrl *string `json:"jupyter_url,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TerminateInstanceV1ResponseDataTerminatedInstancesInner TerminateInstanceV1ResponseDataTerminatedInstancesInner + +// NewTerminateInstanceV1ResponseDataTerminatedInstancesInner instantiates a new TerminateInstanceV1ResponseDataTerminatedInstancesInner 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 NewTerminateInstanceV1ResponseDataTerminatedInstancesInner() *TerminateInstanceV1ResponseDataTerminatedInstancesInner { + this := TerminateInstanceV1ResponseDataTerminatedInstancesInner{} + return &this +} + +// NewTerminateInstanceV1ResponseDataTerminatedInstancesInnerWithDefaults instantiates a new TerminateInstanceV1ResponseDataTerminatedInstancesInner 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 NewTerminateInstanceV1ResponseDataTerminatedInstancesInnerWithDefaults() *TerminateInstanceV1ResponseDataTerminatedInstancesInner { + this := TerminateInstanceV1ResponseDataTerminatedInstancesInner{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) 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 *TerminateInstanceV1ResponseDataTerminatedInstancesInner) 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 *TerminateInstanceV1ResponseDataTerminatedInstancesInner) 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 *TerminateInstanceV1ResponseDataTerminatedInstancesInner) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) SetName(v string) { + o.Name = &v +} + +// GetIp returns the Ip field value if set, zero value otherwise. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetIp() string { + if o == nil || IsNil(o.Ip) { + var ret string + return ret + } + return *o.Ip +} + +// GetIpOk returns a tuple with the Ip field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetIpOk() (*string, bool) { + if o == nil || IsNil(o.Ip) { + return nil, false + } + return o.Ip, true +} + +// HasIp returns a boolean if a field has been set. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) HasIp() bool { + if o != nil && !IsNil(o.Ip) { + return true + } + + return false +} + +// SetIp gets a reference to the given string and assigns it to the Ip field. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) SetIp(v string) { + o.Ip = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) SetStatus(v string) { + o.Status = &v +} + +// GetSshKeyNames returns the SshKeyNames field value if set, zero value otherwise. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetSshKeyNames() []string { + if o == nil || IsNil(o.SshKeyNames) { + var ret []string + return ret + } + return o.SshKeyNames +} + +// GetSshKeyNamesOk returns a tuple with the SshKeyNames field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetSshKeyNamesOk() ([]string, bool) { + if o == nil || IsNil(o.SshKeyNames) { + return nil, false + } + return o.SshKeyNames, true +} + +// HasSshKeyNames returns a boolean if a field has been set. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) HasSshKeyNames() bool { + if o != nil && !IsNil(o.SshKeyNames) { + return true + } + + return false +} + +// SetSshKeyNames gets a reference to the given []string and assigns it to the SshKeyNames field. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) SetSshKeyNames(v []string) { + o.SshKeyNames = v +} + +// GetFileSystemNames returns the FileSystemNames field value if set, zero value otherwise. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetFileSystemNames() []string { + if o == nil || IsNil(o.FileSystemNames) { + var ret []string + return ret + } + return o.FileSystemNames +} + +// GetFileSystemNamesOk returns a tuple with the FileSystemNames field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetFileSystemNamesOk() ([]string, bool) { + if o == nil || IsNil(o.FileSystemNames) { + return nil, false + } + return o.FileSystemNames, true +} + +// HasFileSystemNames returns a boolean if a field has been set. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) HasFileSystemNames() bool { + if o != nil && !IsNil(o.FileSystemNames) { + return true + } + + return false +} + +// SetFileSystemNames gets a reference to the given []string and assigns it to the FileSystemNames field. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) SetFileSystemNames(v []string) { + o.FileSystemNames = v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetRegion() RestartInstanceV1ResponseInnerRegion { + if o == nil || IsNil(o.Region) { + var ret RestartInstanceV1ResponseInnerRegion + return ret + } + return *o.Region +} + +// GetRegionOk returns a tuple with the Region field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetRegionOk() (*RestartInstanceV1ResponseInnerRegion, bool) { + if o == nil || IsNil(o.Region) { + return nil, false + } + return o.Region, true +} + +// HasRegion returns a boolean if a field has been set. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) HasRegion() bool { + if o != nil && !IsNil(o.Region) { + return true + } + + return false +} + +// SetRegion gets a reference to the given RestartInstanceV1ResponseInnerRegion and assigns it to the Region field. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) SetRegion(v RestartInstanceV1ResponseInnerRegion) { + o.Region = &v +} + +// GetInstanceType returns the InstanceType field value if set, zero value otherwise. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetInstanceType() RestartInstanceV1ResponseInnerInstanceType { + if o == nil || IsNil(o.InstanceType) { + var ret RestartInstanceV1ResponseInnerInstanceType + return ret + } + return *o.InstanceType +} + +// GetInstanceTypeOk returns a tuple with the InstanceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetInstanceTypeOk() (*RestartInstanceV1ResponseInnerInstanceType, bool) { + if o == nil || IsNil(o.InstanceType) { + return nil, false + } + return o.InstanceType, true +} + +// HasInstanceType returns a boolean if a field has been set. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) HasInstanceType() bool { + if o != nil && !IsNil(o.InstanceType) { + return true + } + + return false +} + +// SetInstanceType gets a reference to the given RestartInstanceV1ResponseInnerInstanceType and assigns it to the InstanceType field. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) SetInstanceType(v RestartInstanceV1ResponseInnerInstanceType) { + o.InstanceType = &v +} + +// GetJupyterToken returns the JupyterToken field value if set, zero value otherwise. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetJupyterToken() string { + if o == nil || IsNil(o.JupyterToken) { + var ret string + return ret + } + return *o.JupyterToken +} + +// GetJupyterTokenOk returns a tuple with the JupyterToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetJupyterTokenOk() (*string, bool) { + if o == nil || IsNil(o.JupyterToken) { + return nil, false + } + return o.JupyterToken, true +} + +// HasJupyterToken returns a boolean if a field has been set. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) HasJupyterToken() bool { + if o != nil && !IsNil(o.JupyterToken) { + return true + } + + return false +} + +// SetJupyterToken gets a reference to the given string and assigns it to the JupyterToken field. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) SetJupyterToken(v string) { + o.JupyterToken = &v +} + +// GetJupyterUrl returns the JupyterUrl field value if set, zero value otherwise. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetJupyterUrl() string { + if o == nil || IsNil(o.JupyterUrl) { + var ret string + return ret + } + return *o.JupyterUrl +} + +// GetJupyterUrlOk returns a tuple with the JupyterUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) GetJupyterUrlOk() (*string, bool) { + if o == nil || IsNil(o.JupyterUrl) { + return nil, false + } + return o.JupyterUrl, true +} + +// HasJupyterUrl returns a boolean if a field has been set. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) HasJupyterUrl() bool { + if o != nil && !IsNil(o.JupyterUrl) { + return true + } + + return false +} + +// SetJupyterUrl gets a reference to the given string and assigns it to the JupyterUrl field. +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) SetJupyterUrl(v string) { + o.JupyterUrl = &v +} + +func (o TerminateInstanceV1ResponseDataTerminatedInstancesInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TerminateInstanceV1ResponseDataTerminatedInstancesInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Ip) { + toSerialize["ip"] = o.Ip + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.SshKeyNames) { + toSerialize["ssh_key_names"] = o.SshKeyNames + } + if !IsNil(o.FileSystemNames) { + toSerialize["file_system_names"] = o.FileSystemNames + } + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + if !IsNil(o.InstanceType) { + toSerialize["instance_type"] = o.InstanceType + } + if !IsNil(o.JupyterToken) { + toSerialize["jupyter_token"] = o.JupyterToken + } + if !IsNil(o.JupyterUrl) { + toSerialize["jupyter_url"] = o.JupyterUrl + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TerminateInstanceV1ResponseDataTerminatedInstancesInner) UnmarshalJSON(data []byte) (err error) { + varTerminateInstanceV1ResponseDataTerminatedInstancesInner := _TerminateInstanceV1ResponseDataTerminatedInstancesInner{} + + err = json.Unmarshal(data, &varTerminateInstanceV1ResponseDataTerminatedInstancesInner) + + if err != nil { + return err + } + + *o = TerminateInstanceV1ResponseDataTerminatedInstancesInner(varTerminateInstanceV1ResponseDataTerminatedInstancesInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "ip") + delete(additionalProperties, "status") + delete(additionalProperties, "ssh_key_names") + delete(additionalProperties, "file_system_names") + delete(additionalProperties, "region") + delete(additionalProperties, "instance_type") + delete(additionalProperties, "jupyter_token") + delete(additionalProperties, "jupyter_url") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTerminateInstanceV1ResponseDataTerminatedInstancesInner struct { + value *TerminateInstanceV1ResponseDataTerminatedInstancesInner + isSet bool +} + +func (v NullableTerminateInstanceV1ResponseDataTerminatedInstancesInner) Get() *TerminateInstanceV1ResponseDataTerminatedInstancesInner { + return v.value +} + +func (v *NullableTerminateInstanceV1ResponseDataTerminatedInstancesInner) Set(val *TerminateInstanceV1ResponseDataTerminatedInstancesInner) { + v.value = val + v.isSet = true +} + +func (v NullableTerminateInstanceV1ResponseDataTerminatedInstancesInner) IsSet() bool { + return v.isSet +} + +func (v *NullableTerminateInstanceV1ResponseDataTerminatedInstancesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTerminateInstanceV1ResponseDataTerminatedInstancesInner(val *TerminateInstanceV1ResponseDataTerminatedInstancesInner) *NullableTerminateInstanceV1ResponseDataTerminatedInstancesInner { + return &NullableTerminateInstanceV1ResponseDataTerminatedInstancesInner{value: val, isSet: true} +} + +func (v NullableTerminateInstanceV1ResponseDataTerminatedInstancesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTerminateInstanceV1ResponseDataTerminatedInstancesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/response.go b/v1/providers/massedcompute/gen/massedcompute/response.go new file mode 100644 index 0000000..f1c4794 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/response.go @@ -0,0 +1,47 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/v1/providers/massedcompute/gen/massedcompute/test/api_account_test.go b/v1/providers/massedcompute/gen/massedcompute/test/api_account_test.go new file mode 100644 index 0000000..26e5a2d --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/test/api_account_test.go @@ -0,0 +1,44 @@ +/* +Massed Compute VM API + +Testing AccountAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package openapi + +import ( + "context" + "testing" + + openapiclient "github.com/brevdev/cloud/v1/providers/massedcompute/gen/massedcompute" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_openapi_AccountAPIService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test AccountAPIService AccountBillingGet", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AccountAPI.AccountBillingGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test AccountAPIService AccountTokenValidationPost", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AccountAPI.AccountTokenValidationPost(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/test/api_coupon_test.go b/v1/providers/massedcompute/gen/massedcompute/test/api_coupon_test.go new file mode 100644 index 0000000..390146f --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/test/api_coupon_test.go @@ -0,0 +1,44 @@ +/* +Massed Compute VM API + +Testing CouponAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package openapi + +import ( + "context" + "testing" + + openapiclient "github.com/brevdev/cloud/v1/providers/massedcompute/gen/massedcompute" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_openapi_CouponAPIService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test CouponAPIService CouponAcceptedProductsPost", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.CouponAPI.CouponAcceptedProductsPost(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test CouponAPIService CouponInformationPost", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.CouponAPI.CouponInformationPost(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/test/api_default_test.go b/v1/providers/massedcompute/gen/massedcompute/test/api_default_test.go new file mode 100644 index 0000000..a1a72a4 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/test/api_default_test.go @@ -0,0 +1,44 @@ +/* +Massed Compute VM API + +Testing DefaultAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package openapi + +import ( + "context" + "testing" + + openapiclient "github.com/brevdev/cloud/v1/providers/massedcompute/gen/massedcompute" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_openapi_DefaultAPIService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultAPIService GpuInventoryGet", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultAPI.GpuInventoryGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test DefaultAPIService ImagesGet", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultAPI.ImagesGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/test/api_instances_test.go b/v1/providers/massedcompute/gen/massedcompute/test/api_instances_test.go new file mode 100644 index 0000000..ce2efab --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/test/api_instances_test.go @@ -0,0 +1,76 @@ +/* +Massed Compute VM API + +Testing InstancesAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package openapi + +import ( + "context" + "testing" + + openapiclient "github.com/brevdev/cloud/v1/providers/massedcompute/gen/massedcompute" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_openapi_InstancesAPIService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test InstancesAPIService InstanceGet", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.InstancesAPI.InstanceGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test InstancesAPIService InstanceLaunchPost", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.InstancesAPI.InstanceLaunchPost(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test InstancesAPIService InstanceRestartPost", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.InstancesAPI.InstanceRestartPost(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test InstancesAPIService InstanceTerminatePost", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.InstancesAPI.InstanceTerminatePost(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test InstancesAPIService InstanceUuidGet", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var uuid string + + resp, httpRes, err := apiClient.InstancesAPI.InstanceUuidGet(context.Background(), uuid).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/test/api_ssh_keys_test.go b/v1/providers/massedcompute/gen/massedcompute/test/api_ssh_keys_test.go new file mode 100644 index 0000000..4b0747f --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/test/api_ssh_keys_test.go @@ -0,0 +1,56 @@ +/* +Massed Compute VM API + +Testing SSHKeysAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package openapi + +import ( + "context" + "testing" + + openapiclient "github.com/brevdev/cloud/v1/providers/massedcompute/gen/massedcompute" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_openapi_SSHKeysAPIService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test SSHKeysAPIService SshKeysGet", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.SSHKeysAPI.SshKeysGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test SSHKeysAPIService SshKeysIdDelete", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.SSHKeysAPI.SshKeysIdDelete(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test SSHKeysAPIService SshKeysPost", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.SSHKeysAPI.SshKeysPost(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/v1/providers/massedcompute/gen/massedcompute/utils.go b/v1/providers/massedcompute/gen/massedcompute/utils.go new file mode 100644 index 0000000..f904352 --- /dev/null +++ b/v1/providers/massedcompute/gen/massedcompute/utils.go @@ -0,0 +1,361 @@ +/* +Massed Compute VM API + +**API documentation for our direct on-demand offering** *If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com* # Authentication Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints. | Header | Value | | --- | --- | | Authorization | Bearer {{api_token}} | To provision an API key, please see our [API Settings documentation](/docs/settings/api-settings). + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} diff --git a/v1/providers/massedcompute/instance.go b/v1/providers/massedcompute/instance.go new file mode 100644 index 0000000..d8dfc48 --- /dev/null +++ b/v1/providers/massedcompute/instance.go @@ -0,0 +1,448 @@ +package massedcompute + +import ( + "context" + "crypto/x509" + "encoding/pem" + "errors" + "fmt" + "net/http" + "regexp" + "slices" + "strconv" + "strings" + "time" + + v1 "github.com/brevdev/cloud/v1" + openapi "github.com/brevdev/cloud/v1/providers/massedcompute/gen/massedcompute" + "golang.org/x/crypto/ssh" +) + +const ( + defaultSSHPort = 22 + sshKeyNamePrefix = "brevkey" + instanceNameDivider = "_" + defaultImageName = "Ubuntu Server 22.04 w/ drivers" + devPlaneStageTag = "dev-plane-stage" + cloudCredIDTag = "dev-plane-x-cloudCredId" //nolint:gosec // not a credential +) + +var resourceNameInvalidCharacters = regexp.MustCompile(`[^a-zA-Z0-9_-]+`) + +func (c *MassedComputeClient) CreateInstance(ctx context.Context, attrs v1.CreateInstanceAttrs) (*v1.Instance, error) { + if err := validateCreateInstanceAttrs(attrs); err != nil { + return nil, err + } + + startupCommand, err := buildStartupCommand(attrs.FirewallRules) + if err != nil { + return nil, err + } + + imageID, err := c.resolveImageID(ctx, attrs.ImageID) + if err != nil { + return nil, err + } + + publicKey, err := normalizeSSHPublicKey(attrs.PublicKey) + if err != nil { + return nil, err + } + + keyName, err := c.ensureSSHKey(ctx, publicKey, attrs.RefID) + if err != nil { + return nil, err + } + + stage := attrs.Tags[devPlaneStageTag] + if stage == "" { + stage = "unknown" + } + cloudCredID := attrs.Tags[cloudCredIDTag] + if cloudCredID == "" { + cloudCredID = c.refID + } + providerName := makeProviderInstanceName(stage, cloudCredID, attrs.RefID) + instanceID, err := c.launchInstance(ctx, openapi.InstanceLaunchPostRequest{ + ImageId: imageID, + ProductName: attrs.InstanceType, + RegionName: massedComputeRegion, + InstanceName: &providerName, + Command: &startupCommand, + SshKeys: []string{keyName}, + }) + if err != nil { + return nil, err + } + + instance, err := c.GetInstance(ctx, v1.CloudProviderInstanceID(instanceID)) + if err != nil { + return nil, err + } + + return instance, nil +} + +func validateCreateInstanceAttrs(attrs v1.CreateInstanceAttrs) error { + switch { + case attrs.RefID == "": + return errors.New("massed compute instance RefID is required") + case attrs.InstanceType == "": + return errors.New("massed compute instance type is required") + case strings.TrimSpace(attrs.PublicKey) == "": + return errors.New("massed compute instance public key is required") + case attrs.UserDataBase64 != "": + return errors.New("massed compute does not support instance user data") + case attrs.UseSpot || strings.HasSuffix(strings.ToLower(strings.TrimSpace(attrs.InstanceType)), "_spot"): + return errors.New("massed compute spot instances are not supported") + default: + return nil + } +} + +func normalizeSSHPublicKey(publicKey string) (string, error) { + publicKey = strings.TrimSpace(publicKey) + if key, _, _, _, err := ssh.ParseAuthorizedKey([]byte(publicKey)); err == nil { + return strings.TrimSpace(string(ssh.MarshalAuthorizedKey(key))), nil + } + + block, _ := pem.Decode([]byte(publicKey)) + if block == nil { + return "", errors.New("massed compute public key must be OpenSSH or PEM encoded") + } + parsedKey, pkixErr := x509.ParsePKIXPublicKey(block.Bytes) + if pkixErr != nil { + rsaKey, pkcs1Err := x509.ParsePKCS1PublicKey(block.Bytes) + if pkcs1Err != nil { + return "", fmt.Errorf("parse massed compute PEM public key: %w", errors.Join(pkixErr, pkcs1Err)) + } + parsedKey = rsaKey + } + key, err := ssh.NewPublicKey(parsedKey) + if err != nil { + return "", fmt.Errorf("convert massed compute public key to OpenSSH: %w", err) + } + return strings.TrimSpace(string(ssh.MarshalAuthorizedKey(key))), nil +} + +func (c *MassedComputeClient) launchInstance(ctx context.Context, req openapi.InstanceLaunchPostRequest) (string, error) { + resp, httpResp, err := c.client.InstancesAPI.InstanceLaunchPost(ctx). + InstanceLaunchPostRequest(req). + Execute() + defer closeResponseBody(httpResp) + if err != nil { + return "", wrapMassedComputeError(err, httpResp) + } + if resp == nil || resp.Response == nil || *resp.Response == "" { + return "", errors.New("massed compute launch response did not contain an instance UUID") + } + return stringValue(resp.Response), nil +} + +func (c *MassedComputeClient) GetInstance(ctx context.Context, instanceID v1.CloudProviderInstanceID) (*v1.Instance, error) { + resp, err := c.getRunningInstance(ctx, instanceID) + if err != nil { + return nil, err + } + return c.convertInstanceToV1Instance(ctx, resp[0]) +} + +func (c *MassedComputeClient) getRunningInstance(ctx context.Context, instanceID v1.CloudProviderInstanceID) ([]openapi.RetrieveAllRunningInstancesV1RunningInstancesInner, error) { + resp, httpResp, err := c.client.InstancesAPI.InstanceUuidGet(ctx, string(instanceID)).Execute() + defer closeResponseBody(httpResp) + if err != nil { + if httpResp != nil && httpResp.StatusCode == http.StatusNotFound { + return nil, fmt.Errorf("massed compute instance %s: %w", instanceID, v1.ErrInstanceNotFound) + } + return nil, wrapMassedComputeError(err, httpResp) + } + if resp == nil || len(resp.RunningInstances) == 0 { + return nil, errors.New("massed compute get response did not contain instance data") + } + return resp.RunningInstances, nil +} + +func (c *MassedComputeClient) ListInstances(ctx context.Context, args v1.ListInstancesArgs) ([]v1.Instance, error) { + resp, err := c.listRunningInstances(ctx) + if err != nil { + return nil, err + } + + instances := make([]v1.Instance, 0, len(resp)) + for _, providerInstance := range resp { + instance, err := c.convertInstanceToV1Instance(ctx, providerInstance) + if err != nil { + return nil, err + } + if len(args.InstanceIDs) > 0 && !slices.Contains(args.InstanceIDs, instance.CloudID) { + continue + } + if len(args.Locations) > 0 && !args.Locations.IsAllowed(instance.Location) { + continue + } + instances = append(instances, *instance) + } + return instances, nil +} + +func (c *MassedComputeClient) listRunningInstances(ctx context.Context) ([]openapi.RetrieveAllRunningInstancesV1RunningInstancesInner, error) { + resp, httpResp, err := c.client.InstancesAPI.InstanceGet(ctx).Execute() + defer closeResponseBody(httpResp) + if err != nil { + return nil, wrapMassedComputeError(err, httpResp) + } + if resp == nil { + return nil, errors.New("massed compute list response was empty") + } + return resp.RunningInstances, nil +} + +func (c *MassedComputeClient) TerminateInstance(ctx context.Context, instanceID v1.CloudProviderInstanceID) error { + req := openapi.InstanceRestartPostRequest{ + InstanceUuids: []string{string(instanceID)}, + } + err := c.terminateInstance(ctx, req) + return err +} + +func (c *MassedComputeClient) terminateInstance(ctx context.Context, req openapi.InstanceRestartPostRequest) error { + _, httpResp, err := c.client.InstancesAPI.InstanceTerminatePost(ctx). + InstanceRestartPostRequest(req). + Execute() + defer closeResponseBody(httpResp) + if err != nil { + if httpResp != nil && httpResp.StatusCode == http.StatusNotFound { + return nil + } + return wrapMassedComputeError(err, httpResp) + } + return nil +} + +func (c *MassedComputeClient) resolveImageID(ctx context.Context, requestedImage string) (int32, error) { + requestedImage = strings.TrimSpace(requestedImage) + if requestedImage != "" { + imageID, err := strconv.ParseInt(requestedImage, 10, 32) + if err == nil && imageID > 0 { + return int32(imageID), nil + } + } + imageName := requestedImage + if imageName == "" { + imageName = defaultImageName + } + + images, err := c.getImages(ctx) + if err != nil { + return 0, err + } + for _, image := range images { + if strings.EqualFold(strings.TrimSpace(stringValue(image.VmImageName)), imageName) && int32Value(image.VmImageId) > 0 { + return int32Value(image.VmImageId), nil + } + } + return 0, fmt.Errorf("massed compute image %q was not found", imageName) +} + +func (c *MassedComputeClient) resolveImageName(ctx context.Context, imageID int32) (string, error) { + images, err := c.getImages(ctx) + if err != nil { + return "", err + } + for _, image := range images { + if int32Value(image.VmImageId) == imageID && strings.TrimSpace(stringValue(image.VmImageName)) != "" { + return strings.TrimSpace(stringValue(image.VmImageName)), nil + } + } + return "", fmt.Errorf("massed compute image ID %d was not found", imageID) +} + +func (c *MassedComputeClient) getImages(ctx context.Context) ([]openapi.ImagesV1ImagesInner, error) { + resp, httpResp, err := c.client.DefaultAPI.ImagesGet(ctx).Execute() + defer closeResponseBody(httpResp) + if err != nil { + return nil, wrapMassedComputeError(err, httpResp) + } + if resp == nil { + return nil, errors.New("massed compute image response was empty") + } + return resp.Images, nil +} + +func (c *MassedComputeClient) ensureSSHKey(ctx context.Context, publicKey string, refID string) (string, error) { + resp, err := c.listSSHKeys(ctx) + if err != nil { + return "", err + } + if resp == nil || resp.SshKeys == nil { + return "", errors.New("massed compute SSH-key response did not contain data") + } + for _, key := range resp.SshKeys { + if strings.TrimSpace(stringValue(key.PublicKey)) == publicKey { + return stringValue(key.Name), nil + } + } + + // SSH keys cannot contain punctuation other than spaces + keyRefID := strings.ReplaceAll(refID, "-", "") + req := openapi.SshKeysPostRequest{ + Name: managedResourceName(sshKeyNamePrefix, " ", keyRefID), + PublicKey: publicKey, + } + createdKey, err := c.createSSHKey(ctx, req) + if err != nil { + return "", err + } + if createdKey == nil || createdKey.SshKey == nil || createdKey.SshKey.Name == nil { + return "", errors.New("massed compute SSH-key response did not contain data") + } + return stringValue(createdKey.SshKey.Name), nil +} + +func (c *MassedComputeClient) listSSHKeys(ctx context.Context) (*openapi.SSHKey, error) { + resp, httpResp, err := c.client.SSHKeysAPI.SshKeysGet(ctx).Execute() + defer closeResponseBody(httpResp) + if err != nil { + return nil, wrapMassedComputeError(err, httpResp) + } + return resp, nil +} + +func (c *MassedComputeClient) createSSHKey(ctx context.Context, req openapi.SshKeysPostRequest) (*openapi.POSTSSHKey, error) { + resp, httpResp, err := c.client.SSHKeysAPI.SshKeysPost(ctx). + SshKeysPostRequest(req). + Execute() + defer closeResponseBody(httpResp) + if err != nil { + return nil, wrapMassedComputeError(err, httpResp) + } + return resp, nil +} + +func (c *MassedComputeClient) convertInstanceToV1Instance(ctx context.Context, providerInstance openapi.RetrieveAllRunningInstancesV1RunningInstancesInner) (*v1.Instance, error) { + providerName := stringValue(providerInstance.Name) + stage, cloudCredRefID, refID, err := parseProviderInstanceName(providerName) + if err != nil { + return nil, err + } + sshUser := stringValue(providerInstance.Username) + + var instanceType string + var storageGB int32 + if providerInstance.Product != nil { + instanceType = stringValue(providerInstance.Product.Name) + storageGB = int32Value(providerInstance.Product.Storage) + } + + imageName := "" + if providerInstance.Image != nil { + imageName = strings.TrimSpace(stringValue(providerInstance.Image.Name)) + if imageName == "" && int32Value(providerInstance.Image.Id) > 0 { + resolvedImageName, err := c.resolveImageName(ctx, int32Value(providerInstance.Image.Id)) + if err != nil { + return nil, err + } + imageName = resolvedImageName + } + } + + ip := stringValue(providerInstance.Ip) + storageBytes := v1.NewBytes(v1.BytesValue(storageGB), v1.Gigabyte) + instance := &v1.Instance{ + Name: refID, + RefID: refID, + CloudCredRefID: cloudCredRefID, + CloudID: v1.CloudProviderInstanceID(stringValue(providerInstance.Uuid)), + PublicIP: ip, + PublicDNS: ip, + Hostname: providerName, + ImageID: imageName, + InstanceType: instanceType, + SSHUser: sshUser, + SSHPort: defaultSSHPort, + Status: v1.Status{ + LifecycleStatus: massedComputeLifecycleStatus(stringValue(providerInstance.Status)), + }, + Location: massedComputeLocation, + DiskSizeBytes: storageBytes, + DiskSize: legacyBytes(storageBytes), + Tags: v1.Tags{ + devPlaneStageTag: stage, + cloudCredIDTag: cloudCredRefID, + }, + } + if storageBytes.Value() > 0 { + instance.VolumeType = "ssd" + } + if createdAt, err := time.Parse(time.RFC3339Nano, stringValue(providerInstance.Created)); err == nil { + instance.CreatedAt = createdAt + } + instance.InstanceTypeID = v1.MakeGenericInstanceTypeID(v1.InstanceType{ + Type: instance.InstanceType, + Location: massedComputeLocation, + }) + return instance, nil +} + +func massedComputeLifecycleStatus(status string) v1.LifecycleStatus { + switch strings.ToLower(strings.TrimSpace(status)) { + case "active", "running", "rented": + return v1.LifecycleStatusRunning + case "stopping": + return v1.LifecycleStatusStopping + case "stopped": + return v1.LifecycleStatusStopped + case "terminating", "deleting": + return v1.LifecycleStatusTerminating + case "terminated", "deleted": + return v1.LifecycleStatusTerminated + case "failed", "error": + return v1.LifecycleStatusFailed + default: + return v1.LifecycleStatusPending + } +} + +func managedResourceName(prefix string, separator string, refID string) string { + suffix := strings.ToLower(refID) + suffix = resourceNameInvalidCharacters.ReplaceAllString(suffix, separator) + suffix = strings.Trim(suffix, separator) + name := strings.Trim(strings.ToLower(prefix), separator) + if suffix != "" { + name += separator + suffix + } + if len(name) > 63 { + name = strings.TrimRight(name[:63], separator) + } + return name +} + +func makeProviderInstanceName(stage, cloudCredRefID, refID string) string { + return strings.Join([]string{stage, cloudCredRefID, refID}, instanceNameDivider) +} + +func parseProviderInstanceName(providerName string) (string, string, string, error) { + parts := strings.SplitN(providerName, instanceNameDivider, 3) + if len(parts) != 3 || slices.Contains(parts, "") { + return "", "", "", fmt.Errorf("invalid massed compute instance name %q", providerName) + } + return parts[0], parts[1], parts[2], nil +} + +func closeResponseBody(response *http.Response) { + if response != nil && response.Body != nil { + _ = response.Body.Close() + } +} + +func (c *MassedComputeClient) GetInstancePollTime() time.Duration { + return 10 * time.Second +} + +func (c *MassedComputeClient) MergeInstanceForUpdate(_ v1.Instance, updated v1.Instance) v1.Instance { + return updated +} + +func (c *MassedComputeClient) MergeInstanceTypeForUpdate(_ v1.InstanceType, updated v1.InstanceType) v1.InstanceType { + return updated +} diff --git a/v1/providers/massedcompute/instancetype.go b/v1/providers/massedcompute/instancetype.go new file mode 100644 index 0000000..12331d7 --- /dev/null +++ b/v1/providers/massedcompute/instancetype.go @@ -0,0 +1,252 @@ +package massedcompute + +import ( + "context" + "fmt" + "regexp" + "strconv" + "strings" + "time" + + "github.com/alecthomas/units" + "github.com/bojanz/currency" + + v1 "github.com/brevdev/cloud/v1" + openapi "github.com/brevdev/cloud/v1/providers/massedcompute/gen/massedcompute" +) + +var ( + gpuMemoryPattern = regexp.MustCompile(`\(([0-9]+)GB\)`) + descriptionAnnotationPattern = regexp.MustCompile(`\[[^]]*\]`) + gpuMemoryGBByModel = map[string]v1.BytesValue{ + "H100 NVL": 94, + "B200 SXM6": 180, + "B300 SXM6": 288, + } +) + +type massedComputeGPUDescription struct { + count int32 + model string + networkDetails string + memoryBytes v1.Bytes +} + +func (c *MassedComputeClient) GetInstanceTypes(ctx context.Context, args v1.GetInstanceTypeArgs) ([]v1.InstanceType, error) { + inventory, err := c.getInventory(ctx) + if err != nil { + return nil, err + } + + instanceTypes := make([]v1.InstanceType, 0) + for _, item := range inventory { + if item.InstanceType == nil || item.InstanceType.Name == nil || item.InstanceType.Specs == nil { + // Cannot parse instance type + continue + } + + typeName := strings.TrimSpace(*item.InstanceType.Name) + if typeName == "" || isSpotDescription(stringValue(item.InstanceType.Description)) { + continue + } + instanceType, err := massedComputeInstanceType(item) + if err != nil { + return nil, err + } + if v1.IsSelectedByArgs(instanceType, args) { + instanceTypes = append(instanceTypes, instanceType) + } + } + + return instanceTypes, nil +} + +func (c *MassedComputeClient) getInventory(ctx context.Context) (map[string]openapi.GPUInventoryV1GpuInventoryValue, error) { + result, httpResp, err := c.client.DefaultAPI.GpuInventoryGet(ctx).Execute() + defer closeResponseBody(httpResp) + if err != nil { + return nil, wrapMassedComputeError(err, httpResp) + } + if result == nil || result.GpuInventory == nil { + return nil, fmt.Errorf("massed compute instance-type response did not contain data") + } + + return *result.GpuInventory, nil +} + +func massedComputeInstanceType(item openapi.GPUInventoryV1GpuInventoryValue) (v1.InstanceType, error) { + providerType := item.InstanceType + specs := providerType.Specs + typeName := stringValue(providerType.Name) + description := stringValue(providerType.Description) + + price, err := currency.NewAmountFromInt64(int64(int32Value(providerType.PriceCentsPerHour)), "USD") + if err != nil { + return v1.InstanceType{}, fmt.Errorf("parse price for massed compute instance type %s: %w", typeName, err) + } + + memoryBytes := v1.NewBytes(v1.BytesValue(int32Value(specs.MemoryGib)), v1.Gibibyte) + storageBytes := v1.NewBytes(v1.BytesValue(int32Value(specs.StorageGb)), v1.Gigabyte) + architecture := massedComputeArchitecture(description) + gpu := massedComputeGPUs(description) + + instanceType := v1.InstanceType{ + Type: typeName, + Location: massedComputeLocation, + Memory: legacyBytes(memoryBytes), + MemoryBytes: memoryBytes, + VCPU: int32Value(specs.VcpuCount), + SupportedArchitectures: []v1.Architecture{architecture}, + SupportedGPUs: gpu, + SupportedUsageClasses: []string{"on-demand"}, + IsAvailable: item.CapacityAvailable == nil || *item.CapacityAvailable > 0, + BasePrice: &price, + Provider: CloudProviderID, + } + if storageBytes.Value() > 0 { + instanceType.SupportedStorage = []v1.Storage{{ + Type: "ssd", + Count: 1, + Size: legacyBytes(storageBytes), + SizeBytes: storageBytes, + }} + } + instanceType.ID = v1.MakeGenericInstanceTypeID(instanceType) + return instanceType, nil +} + +func massedComputeGPUs(description string) []v1.GPU { + parsed, ok := parseMassedComputeGPUDescription(description) + if !ok { + return nil + } + + gpu := v1.GPU{ + Count: parsed.count, + Manufacturer: v1.ManufacturerNVIDIA, + Name: parsed.model, + Type: parsed.model, + NetworkDetails: parsed.networkDetails, + MemoryBytes: parsed.memoryBytes, + } + if gpu.MemoryBytes.Value() > 0 { + gpu.Memory = legacyBytes(gpu.MemoryBytes) + } + return []v1.GPU{gpu} +} + +func massedComputeArchitecture(description string) v1.Architecture { + lowerDescription := strings.ToLower(description) + if strings.Contains(lowerDescription, "gh200") || strings.Contains(lowerDescription, "gb200") || strings.Contains(lowerDescription, "gb300") { + return v1.ArchitectureARM64 + } + return v1.ArchitectureX86_64 +} + +func isSpotDescription(description string) bool { + return strings.Contains(strings.ToLower(description), "[spot]") +} + +func parseMassedComputeGPUDescription(description string) (massedComputeGPUDescription, bool) { + if isSpotDescription(description) { + return massedComputeGPUDescription{}, false + } + + // Massed Compute GPU descriptions start with "nx ". + parts := strings.SplitN(strings.TrimSpace(description), " ", 2) + if len(parts) != 2 { + return massedComputeGPUDescription{}, false + } + countText, ok := strings.CutSuffix(strings.ToLower(parts[0]), "x") + if !ok { + return massedComputeGPUDescription{}, false + } + count, err := strconv.ParseInt(countText, 10, 32) + if err != nil || count <= 0 { + return massedComputeGPUDescription{}, false + } + + // Retain the remaining description for later processing + description = parts[1] + memoryBytes := v1.Bytes{} + + // The description usually (but not always!) contains the GB memory size in parenthesis: "nx (GB)" + if match := gpuMemoryPattern.FindStringSubmatch(description); len(match) == 2 { + if memoryGB, err := strconv.ParseInt(match[1], 10, 64); err == nil && memoryGB > 0 { + memoryBytes = v1.NewBytes(v1.BytesValue(memoryGB), v1.Gigabyte) + } + } + + // Remove the memory size from the description + description = gpuMemoryPattern.ReplaceAllString(description, "") + + // Annotations sometimes (but not always!) exist as additional information in the description: "nx [annotation]" + description = descriptionAnnotationPattern.ReplaceAllString(description, "") + + // The description is now in the format " ", but note that the model name may contain spaces, and the interconnect + // may not be present. + fields := strings.Fields(description) + modelKey := strings.ToUpper(strings.Join(fields, " ")) + + model := make([]string, 0, len(fields)) + networkDetails := "" + for _, field := range fields { + if interconnect, ok := massedComputeInterconnect(field); ok { + // We reached the interconnect, so we can stop processing the fields + networkDetails = interconnect + continue + } + model = append(model, field) + } + if len(model) == 0 { + return massedComputeGPUDescription{}, false + } + + modelName := strings.Join(model, " ") + // We have the model, but we failed to parse the memory size from the description. As a backup, we can use the model name to look up the memory size. + if memoryBytes.Value() == 0 { + if memoryGB, ok := gpuMemoryGBByModel[modelKey]; ok { + memoryBytes = v1.NewBytes(memoryGB, v1.Gigabyte) + } + } + + return massedComputeGPUDescription{ + count: int32(count), + model: modelName, + networkDetails: networkDetails, + memoryBytes: memoryBytes, + }, true +} + +func massedComputeInterconnect(value string) (string, bool) { + value = strings.ToUpper(strings.TrimSpace(value)) + if value == "NVL" || value == "NVLINK" { + return "NVLink", true + } + if strings.HasPrefix(value, "SXM") { + return value, true + } + return "", false +} + +func legacyBytes(size v1.Bytes) units.Base2Bytes { + return units.Base2Bytes(size.ByteCount().Int64()) +} + +func stringValue(value *string) string { + if value == nil { + return "" + } + return *value +} + +func int32Value(value *int32) int32 { + if value == nil { + return 0 + } + return *value +} + +func (c *MassedComputeClient) GetInstanceTypePollTime() time.Duration { + return time.Minute +} diff --git a/v1/providers/massedcompute/location.go b/v1/providers/massedcompute/location.go new file mode 100644 index 0000000..0176a1f --- /dev/null +++ b/v1/providers/massedcompute/location.go @@ -0,0 +1,15 @@ +package massedcompute + +import ( + "context" + + v1 "github.com/brevdev/cloud/v1" +) + +func (c *MassedComputeClient) GetLocations(_ context.Context, _ v1.GetLocationsArgs) ([]v1.Location, error) { + return []v1.Location{{ + Name: massedComputeLocation, + Description: "Massed Compute", + Available: true, + }}, nil +} diff --git a/v1/providers/massedcompute/openapi-v1.0.0.final.yaml b/v1/providers/massedcompute/openapi-v1.0.0.final.yaml new file mode 100644 index 0000000..054284b --- /dev/null +++ b/v1/providers/massedcompute/openapi-v1.0.0.final.yaml @@ -0,0 +1,821 @@ +openapi: 3.0.0 +info: + title: Massed Compute VM API + description: > + **API documentation for our direct on-demand offering** + + + *If you are a marketplace looking to leverage our GPU inventory please + contact us at techadmin@massedcompute.com* + + # Authentication + + Authentication of every endpoint provided requres a API token. We leverage + Bearer token authentication on our endpoints. + + + | Header | Value | + + | --- | --- | + + | Authorization | Bearer {{api_token}} | + + + To provision an API key, please see our [API Settings + documentation](/docs/settings/api-settings). + version: 1.0.0 +servers: + - url: https://vm.massedcompute.com/api/v1 +paths: + /gpu-inventory: + get: + summary: Retrieve a list of avaialable GPU configurations. + description: >- + An comprehensive list of all GPU types, configurations, and available + inventory. + responses: + '200': + description: A list of available GPUs + content: + application/json: + schema: + $ref: '#/components/schemas/GPUInventoryV1' + /images: + get: + summary: Retrieve list of available images. + description: An Image is a preconfigured operating system and software stack. + responses: + '200': + description: A list of available images + content: + application/json: + schema: + $ref: '#/components/schemas/ImagesV1' + /instance: + get: + summary: Retrieve list of all running instances. + description: An instance is a virtual machine that is currently running. + tags: + - Instances + responses: + '200': + description: A list of all running instances + content: + application/json: + schema: + $ref: '#/components/schemas/RetrieveAllRunningInstancesV1' + /instance/{uuid}: + get: + summary: Retrieve single running instances. + description: An instance is a virtual machine that is currently running. + tags: + - Instances + responses: + '200': + description: A list of all running instances + content: + application/json: + schema: + $ref: '#/components/schemas/RetrieveAllRunningInstancesV1' + parameters: + - name: uuid + in: path + required: true + schema: + type: string + /instance/launch: + post: + summary: Deploy new instances. + tags: + - Instances + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - imageId + - productName + - regionName + properties: + imageId: + type: integer + description: The ID of the image to deploy + productName: + type: string + description: >- + The product name of the GPU instance you want to deploy. + Example = 'gpu_1x_l40' + regionName: + type: string + description: Set value equal to 'any' + instanceName: + type: string + description: The name of the instance you want to deploy + coupon: + type: string + description: The coupon code you want to apply to the instance + command: + type: string + description: The command you want to run on startup + sshKeys: + type: array + items: + type: string + description: The SSH key you want to use to connect to the instance + responses: + '202': + description: Success deploying instance + content: + application/json: + schema: + type: object + properties: + response: + type: string + example: 8b52a46b-uuid-4fde-xxxx-6d13226908f7 + /instance/restart: + post: + summary: Restart an instances. + tags: + - Instances + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + instanceUuids: + type: array + items: + type: string + description: The ID or IDs of instances to restart + required: + - instanceUuids + example: + instanceUuids: + - string1 + - string2 + responses: + '202': + description: Success restarting instance + content: + application/json: + schema: + $ref: '#/components/schemas/RestartInstanceV1' + /instance/terminate: + post: + summary: Terminate an instances. + description: >- + Termination completely removes the instance from the system and destroys + all data. + tags: + - Instances + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + instanceUuids: + type: array + items: + type: string + description: The ID or IDs of instances to restart + required: + - instanceUuids + example: + instanceUuids: + - string1 + - string2 + responses: + '202': + description: Success restarting instance + content: + application/json: + schema: + $ref: '#/components/schemas/TerminateInstanceV1' + /coupon/information: + post: + summary: Retrieve information about a coupon. + description: >- + A coupon is a discount code that can be applied to an instance when + deployed. + tags: + - Coupon + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + coupon: + type: string + description: The coupon code you want to retrieve information about + required: + - couponCode + responses: + '200': + description: Success retrieving coupon information + content: + application/json: + schema: + $ref: '#/components/schemas/RetrieveCouponInformationV1' + /coupon/accepted-products: + post: + summary: Retrieve products that a coupon is valid for. + description: >- + A coupon is a discount code that can be applied to an instance when + deployed. + tags: + - Coupon + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + coupon: + type: string + description: The coupon code you want to retrieve information about + required: + - couponCode + responses: + '200': + description: Success retrieving coupon information + content: + application/json: + schema: + $ref: '#/components/schemas/RetrieveAcceptProductsV1' + /account/token/validation: + post: + summary: Validate an API token. + description: An API token is required to access the API. + tags: + - Account + responses: + '200': + description: Success validating token + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: Valid Token + /account/billing: + get: + summary: Retrieve billing information. + description: Billing information for the account. + tags: + - Account + responses: + '200': + description: Success retrieving billing information + content: + application/json: + schema: + $ref: '#/components/schemas/RetrieveBillingInformationV1' + /ssh-keys: + get: + summary: Retrieve SSH keys associated with the account. + description: An SSH key is a secure access credential used to connect to instances. + tags: + - SSH Keys + responses: + '200': + description: Success retrieving SSH keys + content: + application/json: + schema: + $ref: '#/components/schemas/SSHKey' + post: + summary: Add an SSH key to the account. + description: An SSH key is a secure access credential used to connect to instances. + tags: + - SSH Keys + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The name of the SSH key + publicKey: + type: string + description: The public key associated with the SSH key + required: + - name + - publicKey + responses: + '200': + description: Success adding SSH key + content: + application/json: + schema: + $ref: '#/components/schemas/POSTSSHKey' + /ssh-keys/{id}: + delete: + summary: Remove an SSH key from the account. + description: An SSH key is a secure access credential used to connect to instances. + tags: + - SSH Keys + parameters: + - name: id + in: path + required: true + schema: + type: string + description: The unique identifier for the SSH key to be removed + responses: + '200': + description: Success removing SSH key + content: + application/json: + schema: + type: object + properties: + result: + type: object +components: + schemas: + GPUInventoryV1: + type: object + properties: + gpu_inventory: + type: object + additionalProperties: + type: object + properties: + instance_type: + type: object + properties: + name: + type: string + description: + type: string + price_cents_per_hour: + type: integer + specs: + type: object + properties: + vcpu_count: + type: integer + memory_gib: + type: integer + storage_gb: + type: integer + regions_with_capacity_available: + type: array + items: + type: object + properties: + name: + type: string + description: + type: string + capacity_available: + type: integer + ImagesV1: + type: object + properties: + images: + type: array + items: + type: object + properties: + vm_image_id: + type: integer + vm_image_name: + type: string + vm_image_description: + type: string + RetrieveAllRunningInstancesV1: + type: object + properties: + runningInstances: + type: array + items: + type: object + properties: + uuid: + type: string + example: 8b52a46b-a892-4fde-925c-6d13226908f7 + name: + type: string + example: Halloween Test + ip: + type: string + example: 1.1.1.1 + username: + type: string + example: Ubuntu + password: + type: string + example: 123456 + status: + type: string + example: rented + os_booted: + type: integer + example: 1 + command_startup: + type: string + example: '' + created: + type: string + example: '2024-08-07T16:41:43.000Z' + active: + type: integer + example: 1 + image: + type: object + properties: + id: + type: integer + example: 7 + name: + type: string + example: Art + description: + type: string + example: >- + AI-powered tools specifically designed for artists and + creatives, providing you with the ability to easily + incorporate AI-generated content into your work. By + harnessing the power of these advanced technologies, you + can take your art to new heights and explore uncharted + territories in the creative world. Leverage the full + potential of AI and transform your artistic process today. + product: + type: object + properties: + name: + type: string + example: gpu_1x_l40 + description: + type: string + example: 1x L40 + gpu_count: + type: integer + example: 1 + vcpu: + type: integer + example: 26 + ram: + type: integer + example: 128 + storage: + type: integer + example: 625 + price_hr: + type: string + example: 0.99 + final_price_hr: + type: string + example: 0 + RetrieveSingleRunningInstanceV1: + type: object + properties: + runningInstance: + type: object + properties: + uuid: + type: string + example: 8b52a46b-a892-4fde-925c-6d13226908f7 + name: + type: string + example: Halloween Test + ip: + type: string + example: 1.1.1.1 + username: + type: string + example: Ubuntu + password: + type: string + example: 123456 + status: + type: string + example: rented + os_booted: + type: integer + example: 1 + command_startup: + type: string + example: '' + created: + type: string + example: '2024-08-07T16:41:43.000Z' + active: + type: integer + example: 1 + image: + type: object + properties: + id: + type: integer + example: 7 + name: + type: string + example: Art + description: + type: string + example: >- + AI-powered tools specifically designed for artists and + creatives, providing you with the ability to easily + incorporate AI-generated content into your work. By + harnessing the power of these advanced technologies, you can + take your art to new heights and explore uncharted + territories in the creative world. Leverage the full + potential of AI and transform your artistic process today. + product: + type: object + properties: + name: + type: string + example: gpu_1x_l40 + description: + type: string + example: 1x L40 + gpu_count: + type: integer + example: 1 + vcpu: + type: integer + example: 26 + ram: + type: integer + example: 128 + storage: + type: integer + example: 625 + price_hr: + type: string + example: '0.990000' + final_price_hr: + type: string + example: '0.000000' + RestartInstanceV1: + type: object + properties: + response: + type: array + items: + type: object + properties: + id: + type: string + example: 2c56cd01-5f0b-4bc2-bb72-3c8e486505e2 + name: + type: string + example: test api deploy1 + ip: + type: string + example: 1.1.1.1 + status: + type: string + example: booting + ssh_key_names: + type: array + items: + type: string + file_system_names: + type: array + items: + type: string + region: + type: object + properties: + name: + type: string + example: us-central-3 + description: + type: string + example: Des Moines, IA + instance_type: + type: object + properties: + name: + type: string + example: gpu_1x_a6000 + description: + type: string + example: 1x RTX A6000 + price_cents_per_hour: + type: integer + example: 0 + specs: + type: object + properties: + vcpus: + type: integer + example: 6 + memory_gib: + type: integer + example: 48 + storage_gb: + type: integer + example: 256 + jupyter_token: + type: string + jupyter_url: + type: string + TerminateInstanceV1: + type: object + properties: + response: + type: object + properties: + data: + type: object + properties: + terminated_instances: + type: array + items: + type: object + properties: + id: + type: string + example: 2c56cd01-5f0b-4bc2-bb72-3c8e486505e2 + name: + type: string + example: test api deploy1 + ip: + type: string + example: 1.1.1.1 + status: + type: string + example: terminated + ssh_key_names: + type: array + items: + type: string + file_system_names: + type: array + items: + type: string + region: + type: object + properties: + name: + type: string + example: us-central-3 + description: + type: string + example: Des Moines, IA + instance_type: + type: object + properties: + name: + type: string + example: gpu_1x_a6000 + description: + type: string + example: 1x RTX A6000 + price_cents_per_hour: + type: integer + example: 0 + specs: + type: object + properties: + vcpus: + type: integer + example: 6 + memory_gib: + type: integer + example: 48 + storage_gb: + type: integer + example: 256 + jupyter_token: + type: string + example: '' + jupyter_url: + type: string + example: '' + RetrieveCouponInformationV1: + type: object + properties: + coupon: + type: object + properties: + code: + type: string + example: TestCoupon + discountPercent: + type: string + example: 0.1 + deactivationDate: + type: string + example: '2024-08-07T16:41:43.000Z' + RetrieveAcceptProductsV1: + type: object + properties: + couponValidation: + type: object + properties: + coupon: + type: object + properties: + code: + type: string + example: TestCoupon + discountPercent: + type: string + example: 0.1 + deactivationDate: + type: string + example: '2024-08-07T16:41:43.000Z' + productDetails: + type: array + items: + type: object + properties: + name: + type: string + example: gpu_1x_a6000 + description: + type: string + example: 1x RTX A6000 + pricePerHour: + type: string + example: '0.625000' + inventoryAvailable: + type: boolean + example: true + example: + - name: gpu_1x_a6000 + description: 1x RTX A6000 + pricePerHour: '0.625000' + inventoryAvailable: true + - name: gpu_2x_a6000 + description: 2x RTX A6000 + pricePerHour: '1.250000' + inventoryAvailable: true + - name: gpu_4x_a6000 + description: 4x RTX A6000 + pricePerHour: '2.500000' + inventoryAvailable: true + - name: gpu_8x_a6000 + description: 8x RTX A6000 + pricePerHour: '5.000000' + inventoryAvailable: false + RetrieveBillingInformationV1: + type: object + properties: + billingMethod: + type: string + example: creditcard + rechargeThresholdCents: + type: integer + example: 1000 + rechargeThreshold: + type: string + example: 10 + rechargeAmountCents: + type: integer + example: 2000 + rechargeAmount: + type: string + example: 20 + SSHKeyItem: + type: object + properties: + id: + type: string + description: The unique identifier for the SSH key + name: + type: string + description: The name of the SSH key + public_key: + type: string + description: The public key associated with the SSH key + SSHKey: + type: object + properties: + sshKeys: + type: array + items: + $ref: '#/components/schemas/SSHKeyItem' + POSTSSHKey: + type: object + properties: + sshKey: + type: object + properties: + id: + type: string + description: The unique identifier for the SSH key + name: + type: string + description: The name of the SSH key diff --git a/v1/providers/massedcompute/openapi-v1.0.0.patch b/v1/providers/massedcompute/openapi-v1.0.0.patch new file mode 100644 index 0000000..27003ad --- /dev/null +++ b/v1/providers/massedcompute/openapi-v1.0.0.patch @@ -0,0 +1,107 @@ +--- openapi-v1.0.0.yaml ++++ openapi-v1.0.0.final.yaml +@@ -77,6 +77,12 @@ + application/json: + schema: +- $ref: '#/components/schemas/RetrieveSingleRunningInstanceV1' ++ $ref: '#/components/schemas/RetrieveAllRunningInstancesV1' ++ parameters: ++ - name: uuid ++ in: path ++ required: true ++ schema: ++ type: string + /instance/launch: + post: + summary: Deploy new instances. +@@ -89,24 +95,21 @@ + schema: + type: object + required: +- - image_id ++ - imageId + - productName + - regionName + properties: + imageId: + type: integer + description: The ID of the image to deploy +- required: true + productName: + type: string + description: >- + The product name of the GPU instance you want to deploy. + Example = 'gpu_1x_l40' +- required: true + regionName: + type: string + description: Set value equal to 'any' +- required: true + instanceName: + type: string + description: The name of the instance you want to deploy +@@ -151,10 +154,10 @@ + description: The ID or IDs of instances to restart + required: + - instanceUuids +- example: +- instanceUuids: +- - string1 +- - string2 ++ example: ++ instanceUuids: ++ - string1 ++ - string2 + responses: + '202': + description: Success restarting instance +@@ -184,10 +187,10 @@ + description: The ID or IDs of instances to restart + required: + - instanceUuids +- example: +- instanceUuids: +- - string1 +- - string2 ++ example: ++ instanceUuids: ++ - string1 ++ - string2 + responses: + '202': + description: Success restarting instance +@@ -679,19 +682,21 @@ + description: + type: string + example: 1x RTX A6000 +- price_cents_per_hour: 0 +- specs: +- type: object +- properties: +- vcpus: +- type: integer +- example: 6 +- memory_gib: +- type: integer +- example: 48 +- storage_gb: +- type: integer +- example: 256 ++ price_cents_per_hour: ++ type: integer ++ example: 0 ++ specs: ++ type: object ++ properties: ++ vcpus: ++ type: integer ++ example: 6 ++ memory_gib: ++ type: integer ++ example: 48 ++ storage_gb: ++ type: integer ++ example: 256 + jupyter_token: + type: string + example: '' diff --git a/v1/providers/massedcompute/openapi-v1.0.0.yaml b/v1/providers/massedcompute/openapi-v1.0.0.yaml new file mode 100644 index 0000000..769f806 --- /dev/null +++ b/v1/providers/massedcompute/openapi-v1.0.0.yaml @@ -0,0 +1,816 @@ +openapi: 3.0.0 +info: + title: Massed Compute VM API + description: > + **API documentation for our direct on-demand offering** + + + *If you are a marketplace looking to leverage our GPU inventory please + contact us at techadmin@massedcompute.com* + + # Authentication + + Authentication of every endpoint provided requres a API token. We leverage + Bearer token authentication on our endpoints. + + + | Header | Value | + + | --- | --- | + + | Authorization | Bearer {{api_token}} | + + + To provision an API key, please see our [API Settings + documentation](/docs/settings/api-settings). + version: 1.0.0 +servers: + - url: https://vm.massedcompute.com/api/v1 +paths: + /gpu-inventory: + get: + summary: Retrieve a list of avaialable GPU configurations. + description: >- + An comprehensive list of all GPU types, configurations, and available + inventory. + responses: + '200': + description: A list of available GPUs + content: + application/json: + schema: + $ref: '#/components/schemas/GPUInventoryV1' + /images: + get: + summary: Retrieve list of available images. + description: An Image is a preconfigured operating system and software stack. + responses: + '200': + description: A list of available images + content: + application/json: + schema: + $ref: '#/components/schemas/ImagesV1' + /instance: + get: + summary: Retrieve list of all running instances. + description: An instance is a virtual machine that is currently running. + tags: + - Instances + responses: + '200': + description: A list of all running instances + content: + application/json: + schema: + $ref: '#/components/schemas/RetrieveAllRunningInstancesV1' + /instance/{uuid}: + get: + summary: Retrieve single running instances. + description: An instance is a virtual machine that is currently running. + tags: + - Instances + responses: + '200': + description: A list of all running instances + content: + application/json: + schema: + $ref: '#/components/schemas/RetrieveSingleRunningInstanceV1' + /instance/launch: + post: + summary: Deploy new instances. + tags: + - Instances + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - image_id + - productName + - regionName + properties: + imageId: + type: integer + description: The ID of the image to deploy + required: true + productName: + type: string + description: >- + The product name of the GPU instance you want to deploy. + Example = 'gpu_1x_l40' + required: true + regionName: + type: string + description: Set value equal to 'any' + required: true + instanceName: + type: string + description: The name of the instance you want to deploy + coupon: + type: string + description: The coupon code you want to apply to the instance + command: + type: string + description: The command you want to run on startup + sshKeys: + type: array + items: + type: string + description: The SSH key you want to use to connect to the instance + responses: + '202': + description: Success deploying instance + content: + application/json: + schema: + type: object + properties: + response: + type: string + example: 8b52a46b-uuid-4fde-xxxx-6d13226908f7 + /instance/restart: + post: + summary: Restart an instances. + tags: + - Instances + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + instanceUuids: + type: array + items: + type: string + description: The ID or IDs of instances to restart + required: + - instanceUuids + example: + instanceUuids: + - string1 + - string2 + responses: + '202': + description: Success restarting instance + content: + application/json: + schema: + $ref: '#/components/schemas/RestartInstanceV1' + /instance/terminate: + post: + summary: Terminate an instances. + description: >- + Termination completely removes the instance from the system and destroys + all data. + tags: + - Instances + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + instanceUuids: + type: array + items: + type: string + description: The ID or IDs of instances to restart + required: + - instanceUuids + example: + instanceUuids: + - string1 + - string2 + responses: + '202': + description: Success restarting instance + content: + application/json: + schema: + $ref: '#/components/schemas/TerminateInstanceV1' + /coupon/information: + post: + summary: Retrieve information about a coupon. + description: >- + A coupon is a discount code that can be applied to an instance when + deployed. + tags: + - Coupon + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + coupon: + type: string + description: The coupon code you want to retrieve information about + required: + - couponCode + responses: + '200': + description: Success retrieving coupon information + content: + application/json: + schema: + $ref: '#/components/schemas/RetrieveCouponInformationV1' + /coupon/accepted-products: + post: + summary: Retrieve products that a coupon is valid for. + description: >- + A coupon is a discount code that can be applied to an instance when + deployed. + tags: + - Coupon + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + coupon: + type: string + description: The coupon code you want to retrieve information about + required: + - couponCode + responses: + '200': + description: Success retrieving coupon information + content: + application/json: + schema: + $ref: '#/components/schemas/RetrieveAcceptProductsV1' + /account/token/validation: + post: + summary: Validate an API token. + description: An API token is required to access the API. + tags: + - Account + responses: + '200': + description: Success validating token + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: Valid Token + /account/billing: + get: + summary: Retrieve billing information. + description: Billing information for the account. + tags: + - Account + responses: + '200': + description: Success retrieving billing information + content: + application/json: + schema: + $ref: '#/components/schemas/RetrieveBillingInformationV1' + /ssh-keys: + get: + summary: Retrieve SSH keys associated with the account. + description: An SSH key is a secure access credential used to connect to instances. + tags: + - SSH Keys + responses: + '200': + description: Success retrieving SSH keys + content: + application/json: + schema: + $ref: '#/components/schemas/SSHKey' + post: + summary: Add an SSH key to the account. + description: An SSH key is a secure access credential used to connect to instances. + tags: + - SSH Keys + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The name of the SSH key + publicKey: + type: string + description: The public key associated with the SSH key + required: + - name + - publicKey + responses: + '200': + description: Success adding SSH key + content: + application/json: + schema: + $ref: '#/components/schemas/POSTSSHKey' + /ssh-keys/{id}: + delete: + summary: Remove an SSH key from the account. + description: An SSH key is a secure access credential used to connect to instances. + tags: + - SSH Keys + parameters: + - name: id + in: path + required: true + schema: + type: string + description: The unique identifier for the SSH key to be removed + responses: + '200': + description: Success removing SSH key + content: + application/json: + schema: + type: object + properties: + result: + type: object +components: + schemas: + GPUInventoryV1: + type: object + properties: + gpu_inventory: + type: object + additionalProperties: + type: object + properties: + instance_type: + type: object + properties: + name: + type: string + description: + type: string + price_cents_per_hour: + type: integer + specs: + type: object + properties: + vcpu_count: + type: integer + memory_gib: + type: integer + storage_gb: + type: integer + regions_with_capacity_available: + type: array + items: + type: object + properties: + name: + type: string + description: + type: string + capacity_available: + type: integer + ImagesV1: + type: object + properties: + images: + type: array + items: + type: object + properties: + vm_image_id: + type: integer + vm_image_name: + type: string + vm_image_description: + type: string + RetrieveAllRunningInstancesV1: + type: object + properties: + runningInstances: + type: array + items: + type: object + properties: + uuid: + type: string + example: 8b52a46b-a892-4fde-925c-6d13226908f7 + name: + type: string + example: Halloween Test + ip: + type: string + example: 1.1.1.1 + username: + type: string + example: Ubuntu + password: + type: string + example: 123456 + status: + type: string + example: rented + os_booted: + type: integer + example: 1 + command_startup: + type: string + example: '' + created: + type: string + example: '2024-08-07T16:41:43.000Z' + active: + type: integer + example: 1 + image: + type: object + properties: + id: + type: integer + example: 7 + name: + type: string + example: Art + description: + type: string + example: >- + AI-powered tools specifically designed for artists and + creatives, providing you with the ability to easily + incorporate AI-generated content into your work. By + harnessing the power of these advanced technologies, you + can take your art to new heights and explore uncharted + territories in the creative world. Leverage the full + potential of AI and transform your artistic process today. + product: + type: object + properties: + name: + type: string + example: gpu_1x_l40 + description: + type: string + example: 1x L40 + gpu_count: + type: integer + example: 1 + vcpu: + type: integer + example: 26 + ram: + type: integer + example: 128 + storage: + type: integer + example: 625 + price_hr: + type: string + example: 0.99 + final_price_hr: + type: string + example: 0 + RetrieveSingleRunningInstanceV1: + type: object + properties: + runningInstance: + type: object + properties: + uuid: + type: string + example: 8b52a46b-a892-4fde-925c-6d13226908f7 + name: + type: string + example: Halloween Test + ip: + type: string + example: 1.1.1.1 + username: + type: string + example: Ubuntu + password: + type: string + example: 123456 + status: + type: string + example: rented + os_booted: + type: integer + example: 1 + command_startup: + type: string + example: '' + created: + type: string + example: '2024-08-07T16:41:43.000Z' + active: + type: integer + example: 1 + image: + type: object + properties: + id: + type: integer + example: 7 + name: + type: string + example: Art + description: + type: string + example: >- + AI-powered tools specifically designed for artists and + creatives, providing you with the ability to easily + incorporate AI-generated content into your work. By + harnessing the power of these advanced technologies, you can + take your art to new heights and explore uncharted + territories in the creative world. Leverage the full + potential of AI and transform your artistic process today. + product: + type: object + properties: + name: + type: string + example: gpu_1x_l40 + description: + type: string + example: 1x L40 + gpu_count: + type: integer + example: 1 + vcpu: + type: integer + example: 26 + ram: + type: integer + example: 128 + storage: + type: integer + example: 625 + price_hr: + type: string + example: '0.990000' + final_price_hr: + type: string + example: '0.000000' + RestartInstanceV1: + type: object + properties: + response: + type: array + items: + type: object + properties: + id: + type: string + example: 2c56cd01-5f0b-4bc2-bb72-3c8e486505e2 + name: + type: string + example: test api deploy1 + ip: + type: string + example: 1.1.1.1 + status: + type: string + example: booting + ssh_key_names: + type: array + items: + type: string + file_system_names: + type: array + items: + type: string + region: + type: object + properties: + name: + type: string + example: us-central-3 + description: + type: string + example: Des Moines, IA + instance_type: + type: object + properties: + name: + type: string + example: gpu_1x_a6000 + description: + type: string + example: 1x RTX A6000 + price_cents_per_hour: + type: integer + example: 0 + specs: + type: object + properties: + vcpus: + type: integer + example: 6 + memory_gib: + type: integer + example: 48 + storage_gb: + type: integer + example: 256 + jupyter_token: + type: string + jupyter_url: + type: string + TerminateInstanceV1: + type: object + properties: + response: + type: object + properties: + data: + type: object + properties: + terminated_instances: + type: array + items: + type: object + properties: + id: + type: string + example: 2c56cd01-5f0b-4bc2-bb72-3c8e486505e2 + name: + type: string + example: test api deploy1 + ip: + type: string + example: 1.1.1.1 + status: + type: string + example: terminated + ssh_key_names: + type: array + items: + type: string + file_system_names: + type: array + items: + type: string + region: + type: object + properties: + name: + type: string + example: us-central-3 + description: + type: string + example: Des Moines, IA + instance_type: + type: object + properties: + name: + type: string + example: gpu_1x_a6000 + description: + type: string + example: 1x RTX A6000 + price_cents_per_hour: 0 + specs: + type: object + properties: + vcpus: + type: integer + example: 6 + memory_gib: + type: integer + example: 48 + storage_gb: + type: integer + example: 256 + jupyter_token: + type: string + example: '' + jupyter_url: + type: string + example: '' + RetrieveCouponInformationV1: + type: object + properties: + coupon: + type: object + properties: + code: + type: string + example: TestCoupon + discountPercent: + type: string + example: 0.1 + deactivationDate: + type: string + example: '2024-08-07T16:41:43.000Z' + RetrieveAcceptProductsV1: + type: object + properties: + couponValidation: + type: object + properties: + coupon: + type: object + properties: + code: + type: string + example: TestCoupon + discountPercent: + type: string + example: 0.1 + deactivationDate: + type: string + example: '2024-08-07T16:41:43.000Z' + productDetails: + type: array + items: + type: object + properties: + name: + type: string + example: gpu_1x_a6000 + description: + type: string + example: 1x RTX A6000 + pricePerHour: + type: string + example: '0.625000' + inventoryAvailable: + type: boolean + example: true + example: + - name: gpu_1x_a6000 + description: 1x RTX A6000 + pricePerHour: '0.625000' + inventoryAvailable: true + - name: gpu_2x_a6000 + description: 2x RTX A6000 + pricePerHour: '1.250000' + inventoryAvailable: true + - name: gpu_4x_a6000 + description: 4x RTX A6000 + pricePerHour: '2.500000' + inventoryAvailable: true + - name: gpu_8x_a6000 + description: 8x RTX A6000 + pricePerHour: '5.000000' + inventoryAvailable: false + RetrieveBillingInformationV1: + type: object + properties: + billingMethod: + type: string + example: creditcard + rechargeThresholdCents: + type: integer + example: 1000 + rechargeThreshold: + type: string + example: 10 + rechargeAmountCents: + type: integer + example: 2000 + rechargeAmount: + type: string + example: 20 + SSHKeyItem: + type: object + properties: + id: + type: string + description: The unique identifier for the SSH key + name: + type: string + description: The name of the SSH key + public_key: + type: string + description: The public key associated with the SSH key + SSHKey: + type: object + properties: + sshKeys: + type: array + items: + $ref: '#/components/schemas/SSHKeyItem' + POSTSSHKey: + type: object + properties: + sshKey: + type: object + properties: + id: + type: string + description: The unique identifier for the SSH key + name: + type: string + description: The name of the SSH key diff --git a/v1/providers/massedcompute/validation_test.go b/v1/providers/massedcompute/validation_test.go new file mode 100644 index 0000000..2fb9ef9 --- /dev/null +++ b/v1/providers/massedcompute/validation_test.go @@ -0,0 +1,85 @@ +package massedcompute + +import ( + "context" + "fmt" + "os" + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/brevdev/cloud/internal/validation" + v1 "github.com/brevdev/cloud/v1" +) + +func TestValidationFunctions(t *testing.T) { + checkValidationCredential(t) + credential := validationCredential() + + validation.RunValidationSuite(t, validation.ProviderConfig{ + Credential: credential, + StableIDs: getStableInstanceTypeIDs(t, credential), + }) +} + +func TestInstanceLifecycleValidation(t *testing.T) { + checkValidationCredential(t) + credential := validationCredential() + + validation.RunInstanceLifecycleValidation(t, validation.ProviderConfig{ + Credential: credential, + StableIDs: getStableInstanceTypeIDs(t, credential), + }) +} + +func TestGetLocations(t *testing.T) { + checkValidationCredential(t) + credential := validationCredential() + + client, err := credential.MakeClient(context.Background(), "") + require.NoError(t, err) + locations, err := client.GetLocations(context.Background(), v1.GetLocationsArgs{}) + require.NoError(t, err) + require.NotEmpty(t, locations) + for _, location := range locations { + fmt.Println(location.Name) + } +} + +func checkValidationCredential(t *testing.T) { + t.Helper() + if os.Getenv("MASSED_COMPUTE_API_TOKEN") != "" { + return + } + if os.Getenv("VALIDATION_TEST") != "" { + t.Fatal("MASSED_COMPUTE_API_TOKEN must be set when VALIDATION_TEST is set") + } + t.Skip("MASSED_COMPUTE_API_TOKEN not set; skipping Massed Compute validation tests") +} + +func validationCredential() *MassedComputeCredential { + credential := NewMassedComputeCredential("validation-test", os.Getenv("MASSED_COMPUTE_API_TOKEN")) + if apiURL := os.Getenv("MASSED_COMPUTE_API_URL"); apiURL != "" { + credential.APIURL = apiURL + } + return credential +} + +func getStableInstanceTypeIDs(t *testing.T, credential *MassedComputeCredential) []v1.InstanceTypeID { + t.Helper() + ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) + defer cancel() + + client, err := credential.MakeClient(ctx, "") + require.NoError(t, err) + instanceTypes, err := client.GetInstanceTypes(ctx, v1.GetInstanceTypeArgs{}) + require.NoError(t, err) + require.NotEmpty(t, instanceTypes) + + stableIDs := make([]v1.InstanceTypeID, 0, len(instanceTypes)) + for _, instanceType := range instanceTypes { + stableIDs = append(stableIDs, instanceType.ID) + } + return stableIDs +}