Skip to content

Commit

Permalink
chore: add rest folder
Browse files Browse the repository at this point in the history
  • Loading branch information
tiwarishubham635 committed Oct 4, 2024
1 parent 4d6646f commit 2bbf1cc
Show file tree
Hide file tree
Showing 2,014 changed files with 71,516 additions and 0 deletions.
58 changes: 58 additions & 0 deletions rest/api/v3/account_provisioning/.openapi-generator
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
.openapi-generator
.openapi-generator-ignore
README.md
api_authenticate_account.go
api_create_account.go
api_delete_account.go
api_get_account_state.go
api_list_account.go
api_list_account_offering.go
api_list_offering.go
api_service.go
api_update_account_offering.go
api_update_account_state.go
docs/AccountList.md
docs/AccountProvisioningAccount.md
docs/AccountProvisioningAccountId.md
docs/AccountProvisioningCatalog.md
docs/AccountProvisioningOfferingList.md
docs/AccountProvisioningOfferingV1.md
docs/AccountProvisioningPagination.md
docs/AccountProvisioningProfile.md
docs/AccountProvisioningStateRead.md
docs/AccountProvisioningStateWrite.md
docs/AuthenticateAccount.md
docs/CatalogEntry.md
docs/CatalogEntryEntitlements.md
docs/CreateAccount.md
docs/CreateAccountParams.md
docs/DeleteAccount.md
docs/ErrorResponse.md
docs/GetAccountState.md
docs/ListAccount.md
docs/ListAccountOffering.md
docs/ListOffering.md
docs/OfferingsToAdd.md
docs/State.md
docs/State1.md
docs/Type.md
docs/UpdateAccountOffering.md
docs/UpdateAccountState.md
model_account_list.go
model_account_provisioning_account.go
model_account_provisioning_account_id.go
model_account_provisioning_catalog.go
model_account_provisioning_offering_list.go
model_account_provisioning_offering_v1.go
model_account_provisioning_pagination.go
model_account_provisioning_profile.go
model_account_provisioning_state_read.go
model_account_provisioning_state_write.go
model_catalog_entry.go
model_catalog_entry_entitlements.go
model_create_account_params.go
model_error_response.go
model_offerings_to_add.go
model_state.go
model_state1.go
model_type.go
23 changes: 23 additions & 0 deletions rest/api/v3/account_provisioning/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -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
87 changes: 87 additions & 0 deletions rest/api/v3/account_provisioning/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Go API client for

The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid.

You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).

## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). 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:
- Build date: 2024-10-04T13:25:43.514185+05:30[Asia/Kolkata]
- Build package: com.sendgrid.oai.go.SendgridGoGenerator
For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us)

## Installation

Install the following dependencies:

```shell
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:

```golang
import "./"
```

## Documentation for API Endpoints

All URIs are relative to *https://api.sendgrid.com*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AuthenticateAccount* | [**AuthenticateAccount**](docs/AuthenticateAccount.md#authenticateaccount) | **Post** /v3/partners/accounts/{AccountID}/sso | Authenticate an account with single sign on
*CreateAccount* | [**CreateAccount**](docs/CreateAccount.md#createaccount) | **Post** /v3/partners/accounts | Create an account
*DeleteAccount* | [**DeleteAccount**](docs/DeleteAccount.md#deleteaccount) | **Delete** /v3/partners/accounts/{AccountID} | Delete an account
*GetAccountState* | [**GetAccountState**](docs/GetAccountState.md#getaccountstate) | **Get** /v3/partners/accounts/{AccountID}/state | Get an account's state
*ListAccount* | [**ListAccount**](docs/ListAccount.md#listaccount) | **Get** /v3/partners/accounts | Get all accounts
*ListAccountOffering* | [**ListAccountOffering**](docs/ListAccountOffering.md#listaccountoffering) | **Get** /v3/partners/accounts/{AccountID}/offerings | Get account offerings
*ListOffering* | [**ListOffering**](docs/ListOffering.md#listoffering) | **Get** /v3/partners/offerings | Get all available offerings
*UpdateAccountOffering* | [**UpdateAccountOffering**](docs/UpdateAccountOffering.md#updateaccountoffering) | **Put** /v3/partners/accounts/{AccountID}/offerings | Update account offerings
*UpdateAccountState* | [**UpdateAccountState**](docs/UpdateAccountState.md#updateaccountstate) | **Put** /v3/partners/accounts/{AccountID}/state | Update an account's state


## Documentation For Models

- [AccountList](AccountList.md)
- [AccountProvisioningAccount](AccountProvisioningAccount.md)
- [AccountProvisioningAccountId](AccountProvisioningAccountId.md)
- [AccountProvisioningCatalog](AccountProvisioningCatalog.md)
- [AccountProvisioningOfferingList](AccountProvisioningOfferingList.md)
- [AccountProvisioningOfferingV1](AccountProvisioningOfferingV1.md)
- [AccountProvisioningPagination](AccountProvisioningPagination.md)
- [AccountProvisioningProfile](AccountProvisioningProfile.md)
- [AccountProvisioningStateRead](AccountProvisioningStateRead.md)
- [AccountProvisioningStateWrite](AccountProvisioningStateWrite.md)
- [CatalogEntry](CatalogEntry.md)
- [CatalogEntryEntitlements](CatalogEntryEntitlements.md)
- [CreateAccountParams](CreateAccountParams.md)
- [ErrorResponse](ErrorResponse.md)
- [OfferingsToAdd](OfferingsToAdd.md)
- [State](State.md)
- [State1](State1.md)
- [Type](Type.md)


## Documentation For Authorization



## BearerAuth

- **Type**: HTTP basic authentication

Example

```golang
auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
UserName: "username",
Password: "password",
})
r, err := client.Service.Operation(auth, args)
```

51 changes: 51 additions & 0 deletions rest/api/v3/account_provisioning/api_authenticate_account.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* This code was generated by
*
* SENDGRID-OAI-GENERATOR
*
* Twilio SendGrid Account Provisioning API
* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

package openapi

import (
"net/url"

"strings"
)

type AuthenticateAccountParam struct {
// Twilio SendGrid account ID
AccountID *string `json:"accountID"`
}

func (params *AuthenticateAccountParam) SetAccountID(AccountID string) *AuthenticateAccountParam {
params.AccountID = &AccountID
return params
}

// Authenticates and logs in a user to Twilio Sendgrid as a specific admin identity configured for SSO by partner. Any additional teammates or subusers will need to log in directly via app.sendgrid.com
func (c *ApiService) AuthenticateAccount(params *AuthenticateAccountParam) (interface{}, error) {
path := "/v3/partners/accounts/{AccountID}/sso"
if params != nil && params.AccountID != nil {
path = strings.Replace(path, "{"+"AccountID"+"}", *params.AccountID, -1)
}

data := url.Values{}
headers := map[string]interface{}{
"Content-Type": "application/x-www-form-urlencoded",
}

resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
if err != nil {
return nil, err
}

defer resp.Body.Close()
return nil, nil
}
73 changes: 73 additions & 0 deletions rest/api/v3/account_provisioning/api_create_account.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* This code was generated by
*
* SENDGRID-OAI-GENERATOR
*
* Twilio SendGrid Account Provisioning API
* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

package openapi

import (
"encoding/json"
"net/url"
)

type CreateAccountParam struct {
//
CreateAccountParams *CreateAccountParams `json:"CreateAccountParams"`
// **OPTIONAL** Custom request header provided ONLY for a test account
TTestAccount *string `json:"T-Test-Account,omitempty"`
}

func (params *CreateAccountParam) SetCreateAccountParams(CreateAccountParams CreateAccountParams) *CreateAccountParam {
params.CreateAccountParams = &CreateAccountParams
return params
}
func (params *CreateAccountParam) SetTTestAccount(TTestAccount string) *CreateAccountParam {
params.TTestAccount = &TTestAccount
return params
}

// Creates a new account, with specified offering, under the organization.
func (c *ApiService) CreateAccount(params *CreateAccountParam) (interface{}, error) {
path := "/v3/partners/accounts"

data := url.Values{}
headers := map[string]interface{}{
"Content-Type": "application/json",
}

body := []byte{}
if params != nil && params.CreateAccountParams != nil {
b, err := json.Marshal(*params.CreateAccountParams)
if err != nil {
return nil, err
}
body = b
}

if params != nil && params.TTestAccount != nil {
headers["T-Test-Account"] = *params.TTestAccount
}
resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...)
if err != nil {
return nil, err
}

defer resp.Body.Close()
if resp.StatusCode == 201 {
ps := &AccountProvisioningAccountId{}
if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
return nil, err
}

return ps, err
}
return nil, nil
}
51 changes: 51 additions & 0 deletions rest/api/v3/account_provisioning/api_delete_account.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* This code was generated by
*
* SENDGRID-OAI-GENERATOR
*
* Twilio SendGrid Account Provisioning API
* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

package openapi

import (
"net/url"

"strings"
)

type DeleteAccountParam struct {
// Twilio SendGrid account ID
AccountID *string `json:"accountID"`
}

func (params *DeleteAccountParam) SetAccountID(AccountID string) *DeleteAccountParam {
params.AccountID = &AccountID
return params
}

// Delete a specific account under your organization by account ID. Note that this is an **irreversible** action that does the following: - Revokes API Keys and SSO so that the account user cannot log in or access SendGrid data. - Removes all offerings and configured SendGrid resources such as dedicated IPs. - Cancels billing effective immediately.
func (c *ApiService) DeleteAccount(params *DeleteAccountParam) (interface{}, error) {
path := "/v3/partners/accounts/{AccountID}"
if params != nil && params.AccountID != nil {
path = strings.Replace(path, "{"+"AccountID"+"}", *params.AccountID, -1)
}

data := url.Values{}
headers := map[string]interface{}{
"Content-Type": "application/x-www-form-urlencoded",
}

resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers)
if err != nil {
return nil, err
}

defer resp.Body.Close()
return nil, nil
}
Loading

0 comments on commit 2bbf1cc

Please sign in to comment.