Skip to content

Latest commit

 

History

History
193 lines (128 loc) · 7.06 KB

File metadata and controls

193 lines (128 loc) · 7.06 KB

Organizations

(Organizations)

Overview

REST APIs for managing Organizations (speakeasy L1 Tenancy construct)

Available Operations

  • Create - Create an organization
  • CreateFreeTrial - Create a free trial for an organization
  • Get - Get organization
  • GetAll - Get organizations for a user
  • GetUsage - Get billing usage summary for a particular organization

Create

Creates an organization

Example Usage

using SpeakeasySDK;
using SpeakeasySDK.Models.Shared;
using System;

var sdk = new SDK(security: new Security() {
    APIKey = "<YOUR_API_KEY_HERE>",
});

Organization req = new Organization() {
    AccountType = AccountType.ScaleUp,
    CreatedAt = System.DateTime.Parse("2024-11-30T17:06:07.804Z"),
    Id = "<id>",
    Name = "<value>",
    Slug = "<value>",
    SsoActivated = false,
    TelemetryDisabled = false,
    UpdatedAt = System.DateTime.Parse("2024-04-02T12:48:32.253Z"),
};

var res = await sdk.Organizations.CreateAsync(req);

// handle response

Parameters

Parameter Type Required Description
request Organization ✔️ The request object to use for the request.

Response

CreateOrganizationResponse

Errors

Error Type Status Code Content Type
SpeakeasySDK.Models.Errors.Error 4XX application/json
SpeakeasySDK.Models.Errors.SDKException 5XX */*

CreateFreeTrial

Creates a free trial for an organization

Example Usage

using SpeakeasySDK;
using SpeakeasySDK.Models.Shared;

var sdk = new SDK(security: new Security() {
    APIKey = "<YOUR_API_KEY_HERE>",
});

var res = await sdk.Organizations.CreateFreeTrialAsync();

// handle response

Response

CreateFreeTrialResponse

Errors

Error Type Status Code Content Type
SpeakeasySDK.Models.Errors.Error 4XX application/json
SpeakeasySDK.Models.Errors.SDKException 5XX */*

Get

Get information about a particular organization.

Example Usage

using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;

var sdk = new SDK(security: new Security() {
    APIKey = "<YOUR_API_KEY_HERE>",
});

GetOrganizationRequest req = new GetOrganizationRequest() {
    OrganizationID = "<id>",
};

var res = await sdk.Organizations.GetAsync(req);

// handle response

Parameters

Parameter Type Required Description
request GetOrganizationRequest ✔️ The request object to use for the request.

Response

GetOrganizationResponse

Errors

Error Type Status Code Content Type
SpeakeasySDK.Models.Errors.Error 4XX application/json
SpeakeasySDK.Models.Errors.SDKException 5XX */*

GetAll

Returns a list of organizations a user has access too

Example Usage

using SpeakeasySDK;
using SpeakeasySDK.Models.Shared;

var sdk = new SDK(security: new Security() {
    APIKey = "<YOUR_API_KEY_HERE>",
});

var res = await sdk.Organizations.GetAllAsync();

// handle response

Response

GetOrganizationsResponse

Errors

Error Type Status Code Content Type
SpeakeasySDK.Models.Errors.Error 4XX application/json
SpeakeasySDK.Models.Errors.SDKException 5XX */*

GetUsage

Returns a billing usage summary by target languages for a particular organization

Example Usage

using SpeakeasySDK;
using SpeakeasySDK.Models.Shared;

var sdk = new SDK(security: new Security() {
    APIKey = "<YOUR_API_KEY_HERE>",
});

var res = await sdk.Organizations.GetUsageAsync();

// handle response

Response

GetOrganizationUsageResponse

Errors

Error Type Status Code Content Type
SpeakeasySDK.Models.Errors.Error 4XX application/json
SpeakeasySDK.Models.Errors.SDKException 5XX */*