diff --git a/rest/api/v3/mc_designs/.openapi-generator b/rest/api/v3/mc_designs/.openapi-generator new file mode 100644 index 00000000..6f44dcb1 --- /dev/null +++ b/rest/api/v3/mc_designs/.openapi-generator @@ -0,0 +1,43 @@ +.openapi-generator +README.md +api_create_design.go +api_delete_design.go +api_duplicate_design.go +api_duplicate_pre_built_design.go +api_get_design.go +api_get_pre_built_design.go +api_list_design.go +api_list_pre_built_design.go +api_service.go +api_update_design.go +docs/ApiError.md +docs/ApiErrors.md +docs/CreateDesign.md +docs/DeleteDesign.md +docs/DesignCommonProperties.md +docs/DesignDuplicateInput.md +docs/DesignInput.md +docs/DesignOutput.md +docs/DesignOutputSummary.md +docs/DuplicateDesign.md +docs/DuplicatePreBuiltDesign.md +docs/Editor.md +docs/GetDesign.md +docs/GetPreBuiltDesign.md +docs/ListDesign.md +docs/ListDesign200Response.md +docs/ListPreBuiltDesign.md +docs/Metadata.md +docs/UpdateDesign.md +docs/UpdateDesignRequest.md +model_api_error.go +model_api_errors.go +model_design_common_properties.go +model_design_duplicate_input.go +model_design_input.go +model_design_output.go +model_design_output_summary.go +model_editor.go +model_list_design_200_response.go +model_metadata.go +model_update_design_request.go diff --git a/rest/api/v3/mc_designs/.openapi-generator-ignore b/rest/api/v3/mc_designs/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/rest/api/v3/mc_designs/.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/rest/api/v3/mc_designs/README.md b/rest/api/v3/mc_designs/README.md new file mode 100644 index 00000000..3de167f1 --- /dev/null +++ b/rest/api/v3/mc_designs/README.md @@ -0,0 +1,84 @@ +# Go API client for + +The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). + +The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. + +You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. + +The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. + +## 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:44.066640+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 +------------ | ------------- | ------------- | ------------- +*CreateDesign* | [**CreateDesign**](docs/CreateDesign.md#createdesign) | **Post** /v3/designs | Create Design +*DeleteDesign* | [**DeleteDesign**](docs/DeleteDesign.md#deletedesign) | **Delete** /v3/designs/{Id} | Delete Design +*DuplicateDesign* | [**DuplicateDesign**](docs/DuplicateDesign.md#duplicatedesign) | **Post** /v3/designs/{Id} | Duplicate Design +*DuplicatePreBuiltDesign* | [**DuplicatePreBuiltDesign**](docs/DuplicatePreBuiltDesign.md#duplicateprebuiltdesign) | **Post** /v3/designs/pre-builts/{Id} | Duplicate SendGrid Pre-built Design +*GetDesign* | [**GetDesign**](docs/GetDesign.md#getdesign) | **Get** /v3/designs/{Id} | Get Design +*GetPreBuiltDesign* | [**GetPreBuiltDesign**](docs/GetPreBuiltDesign.md#getprebuiltdesign) | **Get** /v3/designs/pre-builts/{Id} | Get SendGrid Pre-built Design +*ListDesign* | [**ListDesign**](docs/ListDesign.md#listdesign) | **Get** /v3/designs | List Designs +*ListPreBuiltDesign* | [**ListPreBuiltDesign**](docs/ListPreBuiltDesign.md#listprebuiltdesign) | **Get** /v3/designs/pre-builts | List SendGrid Pre-built Designs +*UpdateDesign* | [**UpdateDesign**](docs/UpdateDesign.md#updatedesign) | **Patch** /v3/designs/{Id} | Update Design + + +## Documentation For Models + + - [ApiError](ApiError.md) + - [ApiErrors](ApiErrors.md) + - [DesignCommonProperties](DesignCommonProperties.md) + - [DesignDuplicateInput](DesignDuplicateInput.md) + - [DesignInput](DesignInput.md) + - [DesignOutput](DesignOutput.md) + - [DesignOutputSummary](DesignOutputSummary.md) + - [Editor](Editor.md) + - [ListDesign200Response](ListDesign200Response.md) + - [Metadata](Metadata.md) + - [UpdateDesignRequest](UpdateDesignRequest.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) +``` + diff --git a/rest/api/v3/mc_designs/api_create_design.go b/rest/api/v3/mc_designs/api_create_design.go new file mode 100644 index 00000000..c8b41d3c --- /dev/null +++ b/rest/api/v3/mc_designs/api_create_design.go @@ -0,0 +1,72 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* 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 CreateDesignParam struct { + // + DesignInput *DesignInput `json:"DesignInput,omitempty"` +} + +func (params *CreateDesignParam) SetDesignInput(DesignInput DesignInput) *CreateDesignParam { + params.DesignInput = &DesignInput + return params +} + +// **This endpoint allows you to create a new design**. You can add a new design by passing data, including a string of HTML email content, to `/designs`. When creating designs from scratch, be aware of the styling constraints inherent to many email clients. For a list of best practices, see our guide to [Cross-Platform Email Design](https://sendgrid.com/docs/ui/sending-email/cross-platform-html-design/). The Design Library can also convert your design’s HTML elements into drag and drop modules that are editable in the Designs Library user interface. For more, visit the [Design and Code Editor documentation](https://sendgrid.com/docs/ui/sending-email/editor/#drag--drop-markup). Because the `/designs` endpoint makes it easy to add designs, you can create a design with your preferred tooling or migrate designs you already own without relying on the Design Library UI. +func (c *ApiService) CreateDesign(params *CreateDesignParam) (interface{}, error) { + path := "/v3/designs" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.DesignInput != nil { + b, err := json.Marshal(*params.DesignInput) + if err != nil { + return nil, err + } + body = b + } + + 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 := &DesignOutput{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/mc_designs/api_delete_design.go b/rest/api/v3/mc_designs/api_delete_design.go new file mode 100644 index 00000000..eec2321c --- /dev/null +++ b/rest/api/v3/mc_designs/api_delete_design.go @@ -0,0 +1,76 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* 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" + + "strings" +) + +type DeleteDesignParam struct { + // The ID of the Design you want to duplicate. + Id *string `json:"id"` +} + +func (params *DeleteDesignParam) SetId(Id string) *DeleteDesignParam { + params.Id = &Id + return params +} + +// **This endpoint allows you to delete a single design**. Be sure to check the ID of the design you intend to delete before making this request; deleting a design is a permanent action. +func (c *ApiService) DeleteDesign(params *DeleteDesignParam) (interface{}, error) { + path := "/v3/designs/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -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() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/mc_designs/api_duplicate_design.go b/rest/api/v3/mc_designs/api_duplicate_design.go new file mode 100644 index 00000000..823d9a41 --- /dev/null +++ b/rest/api/v3/mc_designs/api_duplicate_design.go @@ -0,0 +1,91 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* 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" + + "strings" +) + +type DuplicateDesignParam struct { + // The ID of the Design you want to duplicate. + Id *string `json:"id"` + // + DesignDuplicateInput *DesignDuplicateInput `json:"DesignDuplicateInput,omitempty"` +} + +func (params *DuplicateDesignParam) SetId(Id string) *DuplicateDesignParam { + params.Id = &Id + return params +} +func (params *DuplicateDesignParam) SetDesignDuplicateInput(DesignDuplicateInput DesignDuplicateInput) *DuplicateDesignParam { + params.DesignDuplicateInput = &DesignDuplicateInput + return params +} + +// **This endpoint allows you to duplicate one of your existing designs**. Modifying an existing design is often the easiest way to create something new. You are not required to pass any data in the body of a request to this endpoint. If you choose to leave the `name` field blank, your duplicate will be assigned the name of the design it was copied from with the text \"Duplicate: \" prepended to it. This name change is only a convenience, as the duplicate will be assigned a unique ID that differentiates it from your other designs. You can modify your duplicate’s name at the time of creation by passing an updated value to the `name` field when making the initial request. More on retrieving design IDs can be found below. +func (c *ApiService) DuplicateDesign(params *DuplicateDesignParam) (interface{}, error) { + path := "/v3/designs/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.DesignDuplicateInput != nil { + b, err := json.Marshal(*params.DesignDuplicateInput) + if err != nil { + return nil, err + } + body = b + } + + 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 := &DesignOutput{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ApiError{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/mc_designs/api_duplicate_pre_built_design.go b/rest/api/v3/mc_designs/api_duplicate_pre_built_design.go new file mode 100644 index 00000000..f8965925 --- /dev/null +++ b/rest/api/v3/mc_designs/api_duplicate_pre_built_design.go @@ -0,0 +1,91 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* 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" + + "strings" +) + +type DuplicatePreBuiltDesignParam struct { + // The ID of the pre-built Design you want to duplicate. + Id *string `json:"id"` + // + DesignDuplicateInput *DesignDuplicateInput `json:"DesignDuplicateInput,omitempty"` +} + +func (params *DuplicatePreBuiltDesignParam) SetId(Id string) *DuplicatePreBuiltDesignParam { + params.Id = &Id + return params +} +func (params *DuplicatePreBuiltDesignParam) SetDesignDuplicateInput(DesignDuplicateInput DesignDuplicateInput) *DuplicatePreBuiltDesignParam { + params.DesignDuplicateInput = &DesignDuplicateInput + return params +} + +// **This endpoint allows you to duplicate one of the pre-built Twilio SendGrid designs**. Like duplicating one of your existing designs, you are not required to pass any data in the body of a request to this endpoint. If you choose to leave the `name` field blank, your duplicate will be assigned the name of the design it was copied from with the text \"Duplicate: \" prepended to it. This name change is only a convenience, as the duplicate design will be assigned a unique ID that differentiates it from your other designs. You can retrieve the IDs for Twilio SendGrid pre-built designs using the \"List SendGrid Pre-built Designs\" endpoint. You can modify your duplicate’s name at the time of creation by passing an updated value to the `name` field when making the initial request. More on retrieving design IDs can be found above. +func (c *ApiService) DuplicatePreBuiltDesign(params *DuplicatePreBuiltDesignParam) (interface{}, error) { + path := "/v3/designs/pre-builts/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.DesignDuplicateInput != nil { + b, err := json.Marshal(*params.DesignDuplicateInput) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &DesignOutput{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/mc_designs/api_get_design.go b/rest/api/v3/mc_designs/api_get_design.go new file mode 100644 index 00000000..39708536 --- /dev/null +++ b/rest/api/v3/mc_designs/api_get_design.go @@ -0,0 +1,76 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* 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" + + "strings" +) + +type GetDesignParam struct { + // The ID of the Design you want to duplicate. + Id *string `json:"id"` +} + +func (params *GetDesignParam) SetId(Id string) *GetDesignParam { + params.Id = &Id + return params +} + +// **This endpoint allows you to retrieve a single design**. A GET request to `/designs/{id}` will retrieve details about a specific design in your Design Library. This endpoint is valuable when retrieving information stored in a field that you wish to update using a PATCH request. +func (c *ApiService) GetDesign(params *GetDesignParam) (interface{}, error) { + path := "/v3/designs/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &DesignOutput{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/mc_designs/api_get_pre_built_design.go b/rest/api/v3/mc_designs/api_get_pre_built_design.go new file mode 100644 index 00000000..026869c5 --- /dev/null +++ b/rest/api/v3/mc_designs/api_get_pre_built_design.go @@ -0,0 +1,76 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* 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" + + "strings" +) + +type GetPreBuiltDesignParam struct { + // The ID of the pre-built Design you want to duplicate. + Id *string `json:"id"` +} + +func (params *GetPreBuiltDesignParam) SetId(Id string) *GetPreBuiltDesignParam { + params.Id = &Id + return params +} + +// **This endpoint allows you to retrieve a single pre-built design**. A GET request to `/designs/pre-builts/{id}` will retrieve details about a specific pre-built design. This endpoint is valuable when retrieving details about a pre-built design that you wish to duplicate and modify. +func (c *ApiService) GetPreBuiltDesign(params *GetPreBuiltDesignParam) (interface{}, error) { + path := "/v3/designs/pre-builts/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &DesignOutput{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/mc_designs/api_list_design.go b/rest/api/v3/mc_designs/api_list_design.go new file mode 100644 index 00000000..246480bf --- /dev/null +++ b/rest/api/v3/mc_designs/api_list_design.go @@ -0,0 +1,78 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/url" +) + +type ListDesignParam struct { + // number of results to return + PageSize *int32 `json:"page_size,omitempty"` + // token corresponding to a specific page of results, as provided by metadata + PageToken *string `json:"page_token,omitempty"` + // set to false to return all fields + Summary *bool `json:"summary,omitempty"` +} + +func (params *ListDesignParam) SetPageSize(PageSize int32) *ListDesignParam { + params.PageSize = &PageSize + return params +} +func (params *ListDesignParam) SetPageToken(PageToken string) *ListDesignParam { + params.PageToken = &PageToken + return params +} +func (params *ListDesignParam) SetSummary(Summary bool) *ListDesignParam { + params.Summary = &Summary + return params +} + +// **This endpoint allows you to retrieve a list of designs already stored in your Design Library**. A GET request to `/designs` will return a list of your existing designs. This endpoint will not return the pre-built Twilio SendGrid designs. Pre-built designs can be retrieved using the `/designs/pre-builts` endpoint, which is detailed below. By default, you will receive 100 results per request; however, you can modify the number of results returned by passing an integer to the `page_size` query parameter. +func (c *ApiService) ListDesign(params *ListDesignParam) (interface{}, error) { + path := "/v3/designs" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.PageSize != nil { + data.Set("page_size", fmt.Sprint(*params.PageSize)) + } + if params != nil && params.PageToken != nil { + data.Set("page_token", *params.PageToken) + } + if params != nil && params.Summary != nil { + data.Set("summary", fmt.Sprint(*params.Summary)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListDesign200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/mc_designs/api_list_pre_built_design.go b/rest/api/v3/mc_designs/api_list_pre_built_design.go new file mode 100644 index 00000000..2416565f --- /dev/null +++ b/rest/api/v3/mc_designs/api_list_pre_built_design.go @@ -0,0 +1,78 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/url" +) + +type ListPreBuiltDesignParam struct { + // number of results to return + PageSize *int32 `json:"page_size,omitempty"` + // token corresponding to a specific page of results, as provided by metadata + PageToken *string `json:"page_token,omitempty"` + // set to false to return all fields + Summary *bool `json:"summary,omitempty"` +} + +func (params *ListPreBuiltDesignParam) SetPageSize(PageSize int32) *ListPreBuiltDesignParam { + params.PageSize = &PageSize + return params +} +func (params *ListPreBuiltDesignParam) SetPageToken(PageToken string) *ListPreBuiltDesignParam { + params.PageToken = &PageToken + return params +} +func (params *ListPreBuiltDesignParam) SetSummary(Summary bool) *ListPreBuiltDesignParam { + params.Summary = &Summary + return params +} + +// **This endpoint allows you to retrieve a list of pre-built designs provided by Twilio SendGrid**. Unlike the `/designs` endpoint where *your* designs are stored, a GET request made to `designs/pre-builts` will retrieve a list of the pre-built Twilio SendGrid designs. This endpoint will not return the designs stored in your Design Library. By default, you will receive 100 results per request; however, you can modify the number of results returned by passing an integer to the `page_size` query parameter. This endpoint is useful for retrieving the IDs of Twilio SendGrid designs that you want to duplicate and modify. +func (c *ApiService) ListPreBuiltDesign(params *ListPreBuiltDesignParam) (interface{}, error) { + path := "/v3/designs/pre-builts" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.PageSize != nil { + data.Set("page_size", fmt.Sprint(*params.PageSize)) + } + if params != nil && params.PageToken != nil { + data.Set("page_token", *params.PageToken) + } + if params != nil && params.Summary != nil { + data.Set("summary", fmt.Sprint(*params.Summary)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListDesign200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/mc_designs/api_service.go b/rest/api/v3/mc_designs/api_service.go new file mode 100644 index 00000000..d0bf8bbe --- /dev/null +++ b/rest/api/v3/mc_designs/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/mc_designs/api_update_design.go b/rest/api/v3/mc_designs/api_update_design.go new file mode 100644 index 00000000..3b1122bc --- /dev/null +++ b/rest/api/v3/mc_designs/api_update_design.go @@ -0,0 +1,91 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* 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" + + "strings" +) + +type UpdateDesignParam struct { + // The ID of the Design you want to duplicate. + Id *string `json:"id"` + // + UpdateDesignRequest *UpdateDesignRequest `json:"UpdateDesignRequest,omitempty"` +} + +func (params *UpdateDesignParam) SetId(Id string) *UpdateDesignParam { + params.Id = &Id + return params +} +func (params *UpdateDesignParam) SetUpdateDesignRequest(UpdateDesignRequest UpdateDesignRequest) *UpdateDesignParam { + params.UpdateDesignRequest = &UpdateDesignRequest + return params +} + +// **This endpoint allows you to edit a design**. The Design API supports PATCH requests, which allow you to make partial updates to a single design. Passing data to a specific field will update only the data stored in that field; all other fields will be unaltered. For example, updating a design's name requires that you make a PATCH request to this endpoint with data specified for the `name` field only. ``` { \"name\": \"\" } ``` +func (c *ApiService) UpdateDesign(params *UpdateDesignParam) (interface{}, error) { + path := "/v3/designs/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateDesignRequest != nil { + b, err := json.Marshal(*params.UpdateDesignRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &DesignOutput{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/mc_designs/docs/ApiError.md b/rest/api/v3/mc_designs/docs/ApiError.md new file mode 100644 index 00000000..65ebab4d --- /dev/null +++ b/rest/api/v3/mc_designs/docs/ApiError.md @@ -0,0 +1,13 @@ +# ApiError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | | +**Field** | **string** | | +**ErrorId** | **string** | | + +[[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/rest/api/v3/mc_designs/docs/ApiErrors.md b/rest/api/v3/mc_designs/docs/ApiErrors.md new file mode 100644 index 00000000..9228c171 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/ApiErrors.md @@ -0,0 +1,11 @@ +# ApiErrors + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ApiError**](ApiError.md) | |[optional] + +[[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/rest/api/v3/mc_designs/docs/CreateDesign.md b/rest/api/v3/mc_designs/docs/CreateDesign.md new file mode 100644 index 00000000..87211de3 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/CreateDesign.md @@ -0,0 +1,48 @@ +# CreateDesign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateDesign**](CreateDesign.md#CreateDesign) | **Post** /v3/designs | Create Design + + + +## CreateDesign + +> DesignOutput CreateDesign(ctx, optional) + +Create Design + +**This endpoint allows you to create a new design**. You can add a new design by passing data, including a string of HTML email content, to `/designs`. When creating designs from scratch, be aware of the styling constraints inherent to many email clients. For a list of best practices, see our guide to [Cross-Platform Email Design](https://sendgrid.com/docs/ui/sending-email/cross-platform-html-design/). The Design Library can also convert your design’s HTML elements into drag and drop modules that are editable in the Designs Library user interface. For more, visit the [Design and Code Editor documentation](https://sendgrid.com/docs/ui/sending-email/editor/#drag--drop-markup). Because the `/designs` endpoint makes it easy to add designs, you can create a design with your preferred tooling or migrate designs you already own without relying on the Design Library UI. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateDesignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**DesignInput** | [**DesignInput**](DesignInput.md) | + +### Return type + +[**DesignOutput**](DesignOutput.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/mc_designs/docs/DeleteDesign.md b/rest/api/v3/mc_designs/docs/DeleteDesign.md new file mode 100644 index 00000000..8b46426a --- /dev/null +++ b/rest/api/v3/mc_designs/docs/DeleteDesign.md @@ -0,0 +1,51 @@ +# DeleteDesign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteDesign**](DeleteDesign.md#DeleteDesign) | **Delete** /v3/designs/{Id} | Delete Design + + + +## DeleteDesign + +> map[string]interface{} DeleteDesign(ctx, Id) + +Delete Design + +**This endpoint allows you to delete a single design**. Be sure to check the ID of the design you intend to delete before making this request; deleting a design is a permanent action. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the Design you want to duplicate. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteDesignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/mc_designs/docs/DesignCommonProperties.md b/rest/api/v3/mc_designs/docs/DesignCommonProperties.md new file mode 100644 index 00000000..70dfa399 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/DesignCommonProperties.md @@ -0,0 +1,15 @@ +# DesignCommonProperties + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the new design. |[optional] [default to "Duplicate: "] +**Editor** | [**Editor**](Editor.md) | The editor used in the UI. |[optional] +**GeneratePlainContent** | **bool** | If true, plain_content is always generated from html_content. If false, plain_content is not altered. |[optional] [default to true] +**Subject** | **string** | Subject of the Design. |[optional] +**Categories** | **[]string** | The list of categories applied to the design |[optional] + +[[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/rest/api/v3/mc_designs/docs/DesignDuplicateInput.md b/rest/api/v3/mc_designs/docs/DesignDuplicateInput.md new file mode 100644 index 00000000..db86680e --- /dev/null +++ b/rest/api/v3/mc_designs/docs/DesignDuplicateInput.md @@ -0,0 +1,12 @@ +# DesignDuplicateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the new design. |[optional] [default to "Duplicate: "] +**Editor** | [**Editor**](Editor.md) | The editor used in the UI. |[optional] + +[[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/rest/api/v3/mc_designs/docs/DesignInput.md b/rest/api/v3/mc_designs/docs/DesignInput.md new file mode 100644 index 00000000..3413ae98 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/DesignInput.md @@ -0,0 +1,14 @@ +# DesignInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the new design. |[optional] [default to "Duplicate: "] +**Editor** | [**Editor**](Editor.md) | The editor used in the UI. |[optional] +**HtmlContent** | **string** | The HTML content of the Design. | +**PlainContent** | **string** | Plain text content of the Design. |[optional] [default to ""] + +[[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/rest/api/v3/mc_designs/docs/DesignOutput.md b/rest/api/v3/mc_designs/docs/DesignOutput.md new file mode 100644 index 00000000..f80ba304 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/DesignOutput.md @@ -0,0 +1,14 @@ +# DesignOutput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the new design. |[optional] [default to "Duplicate: "] +**Editor** | [**Editor**](Editor.md) | The editor used in the UI. |[optional] +**HtmlContent** | **string** | The HTML content of the Design. | +**PlainContent** | **string** | Plain text content of the Design. |[optional] [default to ""] + +[[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/rest/api/v3/mc_designs/docs/DesignOutputSummary.md b/rest/api/v3/mc_designs/docs/DesignOutputSummary.md new file mode 100644 index 00000000..5a0c0a76 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/DesignOutputSummary.md @@ -0,0 +1,16 @@ +# DesignOutputSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | ID of the Design. |[optional] +**UpdatedAt** | **string** | Datetime that Design was last updated. |[optional] +**CreatedAt** | **string** | Datetime that Design was created. |[optional] +**ThumbnailUrl** | **string** | A Thumbnail preview of the template's html content. |[optional] +**Name** | **string** | The name of the new design. |[optional] [default to "Duplicate: "] +**Editor** | [**Editor**](Editor.md) | The editor used in the UI. |[optional] + +[[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/rest/api/v3/mc_designs/docs/DuplicateDesign.md b/rest/api/v3/mc_designs/docs/DuplicateDesign.md new file mode 100644 index 00000000..2496e786 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/DuplicateDesign.md @@ -0,0 +1,52 @@ +# DuplicateDesign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DuplicateDesign**](DuplicateDesign.md#DuplicateDesign) | **Post** /v3/designs/{Id} | Duplicate Design + + + +## DuplicateDesign + +> DesignOutput DuplicateDesign(ctx, Idoptional) + +Duplicate Design + +**This endpoint allows you to duplicate one of your existing designs**. Modifying an existing design is often the easiest way to create something new. You are not required to pass any data in the body of a request to this endpoint. If you choose to leave the `name` field blank, your duplicate will be assigned the name of the design it was copied from with the text \"Duplicate: \" prepended to it. This name change is only a convenience, as the duplicate will be assigned a unique ID that differentiates it from your other designs. You can modify your duplicate’s name at the time of creation by passing an updated value to the `name` field when making the initial request. More on retrieving design IDs can be found below. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the Design you want to duplicate. + +### Other Parameters + +Other parameters are passed through a pointer to a DuplicateDesignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**DesignDuplicateInput** | [**DesignDuplicateInput**](DesignDuplicateInput.md) | + +### Return type + +[**DesignOutput**](DesignOutput.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/mc_designs/docs/DuplicatePreBuiltDesign.md b/rest/api/v3/mc_designs/docs/DuplicatePreBuiltDesign.md new file mode 100644 index 00000000..9d8e805f --- /dev/null +++ b/rest/api/v3/mc_designs/docs/DuplicatePreBuiltDesign.md @@ -0,0 +1,52 @@ +# DuplicatePreBuiltDesign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DuplicatePreBuiltDesign**](DuplicatePreBuiltDesign.md#DuplicatePreBuiltDesign) | **Post** /v3/designs/pre-builts/{Id} | Duplicate SendGrid Pre-built Design + + + +## DuplicatePreBuiltDesign + +> DesignOutput DuplicatePreBuiltDesign(ctx, Idoptional) + +Duplicate SendGrid Pre-built Design + +**This endpoint allows you to duplicate one of the pre-built Twilio SendGrid designs**. Like duplicating one of your existing designs, you are not required to pass any data in the body of a request to this endpoint. If you choose to leave the `name` field blank, your duplicate will be assigned the name of the design it was copied from with the text \"Duplicate: \" prepended to it. This name change is only a convenience, as the duplicate design will be assigned a unique ID that differentiates it from your other designs. You can retrieve the IDs for Twilio SendGrid pre-built designs using the \"List SendGrid Pre-built Designs\" endpoint. You can modify your duplicate’s name at the time of creation by passing an updated value to the `name` field when making the initial request. More on retrieving design IDs can be found above. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the pre-built Design you want to duplicate. + +### Other Parameters + +Other parameters are passed through a pointer to a DuplicatePreBuiltDesignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**DesignDuplicateInput** | [**DesignDuplicateInput**](DesignDuplicateInput.md) | + +### Return type + +[**DesignOutput**](DesignOutput.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/mc_designs/docs/Editor.md b/rest/api/v3/mc_designs/docs/Editor.md new file mode 100644 index 00000000..9d170841 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/Editor.md @@ -0,0 +1,13 @@ +# Editor + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**CODE** | string | (value: `"code"`) +**DESIGN** | string | (value: `"design"`) + + +[[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/rest/api/v3/mc_designs/docs/GetDesign.md b/rest/api/v3/mc_designs/docs/GetDesign.md new file mode 100644 index 00000000..8bd1d16c --- /dev/null +++ b/rest/api/v3/mc_designs/docs/GetDesign.md @@ -0,0 +1,51 @@ +# GetDesign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetDesign**](GetDesign.md#GetDesign) | **Get** /v3/designs/{Id} | Get Design + + + +## GetDesign + +> DesignOutput GetDesign(ctx, Id) + +Get Design + +**This endpoint allows you to retrieve a single design**. A GET request to `/designs/{id}` will retrieve details about a specific design in your Design Library. This endpoint is valuable when retrieving information stored in a field that you wish to update using a PATCH request. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the Design you want to duplicate. + +### Other Parameters + +Other parameters are passed through a pointer to a GetDesignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**DesignOutput**](DesignOutput.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/mc_designs/docs/GetPreBuiltDesign.md b/rest/api/v3/mc_designs/docs/GetPreBuiltDesign.md new file mode 100644 index 00000000..e49acc07 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/GetPreBuiltDesign.md @@ -0,0 +1,51 @@ +# GetPreBuiltDesign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetPreBuiltDesign**](GetPreBuiltDesign.md#GetPreBuiltDesign) | **Get** /v3/designs/pre-builts/{Id} | Get SendGrid Pre-built Design + + + +## GetPreBuiltDesign + +> DesignOutput GetPreBuiltDesign(ctx, Id) + +Get SendGrid Pre-built Design + +**This endpoint allows you to retrieve a single pre-built design**. A GET request to `/designs/pre-builts/{id}` will retrieve details about a specific pre-built design. This endpoint is valuable when retrieving details about a pre-built design that you wish to duplicate and modify. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the pre-built Design you want to duplicate. + +### Other Parameters + +Other parameters are passed through a pointer to a GetPreBuiltDesignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**DesignOutput**](DesignOutput.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/mc_designs/docs/ListDesign.md b/rest/api/v3/mc_designs/docs/ListDesign.md new file mode 100644 index 00000000..f1677008 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/ListDesign.md @@ -0,0 +1,50 @@ +# ListDesign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListDesign**](ListDesign.md#ListDesign) | **Get** /v3/designs | List Designs + + + +## ListDesign + +> ListDesign200Response ListDesign(ctx, optional) + +List Designs + +**This endpoint allows you to retrieve a list of designs already stored in your Design Library**. A GET request to `/designs` will return a list of your existing designs. This endpoint will not return the pre-built Twilio SendGrid designs. Pre-built designs can be retrieved using the `/designs/pre-builts` endpoint, which is detailed below. By default, you will receive 100 results per request; however, you can modify the number of results returned by passing an integer to the `page_size` query parameter. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListDesignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**PageSize** | **int32** | number of results to return +**PageToken** | **string** | token corresponding to a specific page of results, as provided by metadata +**Summary** | **bool** | set to false to return all fields + +### Return type + +[**ListDesign200Response**](ListDesign200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/mc_designs/docs/ListDesign200Response.md b/rest/api/v3/mc_designs/docs/ListDesign200Response.md new file mode 100644 index 00000000..32f31512 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/ListDesign200Response.md @@ -0,0 +1,12 @@ +# ListDesign200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]DesignOutputSummary**](DesignOutputSummary.md) | |[optional] +**Metadata** | [**Metadata**](Metadata.md) | |[optional] + +[[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/rest/api/v3/mc_designs/docs/ListPreBuiltDesign.md b/rest/api/v3/mc_designs/docs/ListPreBuiltDesign.md new file mode 100644 index 00000000..0b635daa --- /dev/null +++ b/rest/api/v3/mc_designs/docs/ListPreBuiltDesign.md @@ -0,0 +1,50 @@ +# ListPreBuiltDesign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListPreBuiltDesign**](ListPreBuiltDesign.md#ListPreBuiltDesign) | **Get** /v3/designs/pre-builts | List SendGrid Pre-built Designs + + + +## ListPreBuiltDesign + +> ListDesign200Response ListPreBuiltDesign(ctx, optional) + +List SendGrid Pre-built Designs + +**This endpoint allows you to retrieve a list of pre-built designs provided by Twilio SendGrid**. Unlike the `/designs` endpoint where *your* designs are stored, a GET request made to `designs/pre-builts` will retrieve a list of the pre-built Twilio SendGrid designs. This endpoint will not return the designs stored in your Design Library. By default, you will receive 100 results per request; however, you can modify the number of results returned by passing an integer to the `page_size` query parameter. This endpoint is useful for retrieving the IDs of Twilio SendGrid designs that you want to duplicate and modify. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListPreBuiltDesignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**PageSize** | **int32** | number of results to return +**PageToken** | **string** | token corresponding to a specific page of results, as provided by metadata +**Summary** | **bool** | set to false to return all fields + +### Return type + +[**ListDesign200Response**](ListDesign200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/mc_designs/docs/Metadata.md b/rest/api/v3/mc_designs/docs/Metadata.md new file mode 100644 index 00000000..6121300c --- /dev/null +++ b/rest/api/v3/mc_designs/docs/Metadata.md @@ -0,0 +1,14 @@ +# Metadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Prev** | **string** | |[optional] +**Self** | **string** | |[optional] +**Next** | **string** | |[optional] +**Count** | **int32** | |[optional] + +[[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/rest/api/v3/mc_designs/docs/UpdateDesign.md b/rest/api/v3/mc_designs/docs/UpdateDesign.md new file mode 100644 index 00000000..e7385735 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/UpdateDesign.md @@ -0,0 +1,52 @@ +# UpdateDesign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateDesign**](UpdateDesign.md#UpdateDesign) | **Patch** /v3/designs/{Id} | Update Design + + + +## UpdateDesign + +> DesignOutput UpdateDesign(ctx, Idoptional) + +Update Design + +**This endpoint allows you to edit a design**. The Design API supports PATCH requests, which allow you to make partial updates to a single design. Passing data to a specific field will update only the data stored in that field; all other fields will be unaltered. For example, updating a design's name requires that you make a PATCH request to this endpoint with data specified for the `name` field only. ``` { \"name\": \"\" } ``` + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the Design you want to duplicate. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateDesignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**UpdateDesignRequest** | [**UpdateDesignRequest**](UpdateDesignRequest.md) | + +### Return type + +[**DesignOutput**](DesignOutput.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/mc_designs/docs/UpdateDesignRequest.md b/rest/api/v3/mc_designs/docs/UpdateDesignRequest.md new file mode 100644 index 00000000..2187c51b --- /dev/null +++ b/rest/api/v3/mc_designs/docs/UpdateDesignRequest.md @@ -0,0 +1,16 @@ +# UpdateDesignRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | Name of the Design. |[optional] [default to "My Design"] +**HtmlContent** | **string** | The HTML content of the Design. |[optional] +**PlainContent** | **string** | Plain text content of the Design. |[optional] [default to ""] +**GeneratePlainContent** | **bool** | If true, plain_content is always generated from html_content. If false, plain_content is not altered. |[optional] [default to true] +**Subject** | **string** | Subject of the Design. |[optional] +**Categories** | **[]string** | The list of categories applied to the design |[optional] + +[[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/rest/api/v3/mc_designs/model_api_error.go b/rest/api/v3/mc_designs/model_api_error.go new file mode 100644 index 00000000..9dbc10bb --- /dev/null +++ b/rest/api/v3/mc_designs/model_api_error.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ApiError struct for ApiError +type ApiError struct { + Message string `json:"message"` + Field string `json:"field"` + ErrorId string `json:"error_id"` +} diff --git a/rest/api/v3/mc_designs/model_api_errors.go b/rest/api/v3/mc_designs/model_api_errors.go new file mode 100644 index 00000000..eedccc2a --- /dev/null +++ b/rest/api/v3/mc_designs/model_api_errors.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ApiErrors struct for ApiErrors +type ApiErrors struct { + Errors *[]ApiError `json:"errors,omitempty"` +} diff --git a/rest/api/v3/mc_designs/model_design_common_properties.go b/rest/api/v3/mc_designs/model_design_common_properties.go new file mode 100644 index 00000000..fc498689 --- /dev/null +++ b/rest/api/v3/mc_designs/model_design_common_properties.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DesignCommonProperties struct for DesignCommonProperties +type DesignCommonProperties struct { + // The name of the new design. + Name *string `json:"name,omitempty"` + // The editor used in the UI. + Editor *Editor `json:"editor,omitempty"` + // If true, plain_content is always generated from html_content. If false, plain_content is not altered. + GeneratePlainContent *bool `json:"generate_plain_content,omitempty"` + // Subject of the Design. + Subject *string `json:"subject,omitempty"` + // The list of categories applied to the design + Categories *[]string `json:"categories,omitempty"` +} diff --git a/rest/api/v3/mc_designs/model_design_duplicate_input.go b/rest/api/v3/mc_designs/model_design_duplicate_input.go new file mode 100644 index 00000000..19eac8f3 --- /dev/null +++ b/rest/api/v3/mc_designs/model_design_duplicate_input.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DesignDuplicateInput struct for DesignDuplicateInput +type DesignDuplicateInput struct { + // The name of the new design. + Name *string `json:"name,omitempty"` + // The editor used in the UI. + Editor *Editor `json:"editor,omitempty"` +} diff --git a/rest/api/v3/mc_designs/model_design_input.go b/rest/api/v3/mc_designs/model_design_input.go new file mode 100644 index 00000000..a64b5bf3 --- /dev/null +++ b/rest/api/v3/mc_designs/model_design_input.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DesignInput struct for DesignInput +type DesignInput struct { + // The name of the new design. + Name *string `json:"name,omitempty"` + // The editor used in the UI. + Editor *Editor `json:"editor,omitempty"` + // The HTML content of the Design. + HtmlContent string `json:"html_content"` + // Plain text content of the Design. + PlainContent *string `json:"plain_content,omitempty"` +} diff --git a/rest/api/v3/mc_designs/model_design_output.go b/rest/api/v3/mc_designs/model_design_output.go new file mode 100644 index 00000000..3cb19435 --- /dev/null +++ b/rest/api/v3/mc_designs/model_design_output.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DesignOutput struct for DesignOutput +type DesignOutput struct { + // The name of the new design. + Name *string `json:"name,omitempty"` + // The editor used in the UI. + Editor *Editor `json:"editor,omitempty"` + // The HTML content of the Design. + HtmlContent string `json:"html_content"` + // Plain text content of the Design. + PlainContent *string `json:"plain_content,omitempty"` +} diff --git a/rest/api/v3/mc_designs/model_design_output_summary.go b/rest/api/v3/mc_designs/model_design_output_summary.go new file mode 100644 index 00000000..00b619d3 --- /dev/null +++ b/rest/api/v3/mc_designs/model_design_output_summary.go @@ -0,0 +1,30 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DesignOutputSummary struct for DesignOutputSummary +type DesignOutputSummary struct { + // ID of the Design. + Id *string `json:"id,omitempty"` + // Datetime that Design was last updated. + UpdatedAt *string `json:"updated_at,omitempty"` + // Datetime that Design was created. + CreatedAt *string `json:"created_at,omitempty"` + // A Thumbnail preview of the template's html content. + ThumbnailUrl *string `json:"thumbnail_url,omitempty"` + // The name of the new design. + Name *string `json:"name,omitempty"` + // The editor used in the UI. + Editor *Editor `json:"editor,omitempty"` +} diff --git a/rest/api/v3/mc_designs/model_editor.go b/rest/api/v3/mc_designs/model_editor.go new file mode 100644 index 00000000..b5fba7d6 --- /dev/null +++ b/rest/api/v3/mc_designs/model_editor.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Editor the model 'Editor' +type Editor string + +// List of Editor +const ( + EDITOR_CODE Editor = "code" + EDITOR_DESIGN Editor = "design" +) diff --git a/rest/api/v3/mc_designs/model_list_design_200_response.go b/rest/api/v3/mc_designs/model_list_design_200_response.go new file mode 100644 index 00000000..e2c23197 --- /dev/null +++ b/rest/api/v3/mc_designs/model_list_design_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListDesign200Response struct for ListDesign200Response +type ListDesign200Response struct { + Result *[]DesignOutputSummary `json:"result,omitempty"` + Metadata *Metadata `json:"_metadata,omitempty"` +} diff --git a/rest/api/v3/mc_designs/model_metadata.go b/rest/api/v3/mc_designs/model_metadata.go new file mode 100644 index 00000000..3d1281ea --- /dev/null +++ b/rest/api/v3/mc_designs/model_metadata.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Metadata struct for Metadata +type Metadata struct { + Prev *string `json:"prev,omitempty"` + Self *string `json:"self,omitempty"` + Next *string `json:"next,omitempty"` + Count *int32 `json:"count,omitempty"` +} diff --git a/rest/api/v3/mc_designs/model_update_design_request.go b/rest/api/v3/mc_designs/model_update_design_request.go new file mode 100644 index 00000000..b25a0cbe --- /dev/null +++ b/rest/api/v3/mc_designs/model_update_design_request.go @@ -0,0 +1,30 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateDesignRequest struct for UpdateDesignRequest +type UpdateDesignRequest struct { + // Name of the Design. + Name *string `json:"name,omitempty"` + // The HTML content of the Design. + HtmlContent *string `json:"html_content,omitempty"` + // Plain text content of the Design. + PlainContent *string `json:"plain_content,omitempty"` + // If true, plain_content is always generated from html_content. If false, plain_content is not altered. + GeneratePlainContent *bool `json:"generate_plain_content,omitempty"` + // Subject of the Design. + Subject *string `json:"subject,omitempty"` + // The list of categories applied to the design + Categories *[]string `json:"categories,omitempty"` +} diff --git a/rest/api/v3/sso/.openapi-generator b/rest/api/v3/sso/.openapi-generator new file mode 100644 index 00000000..9f986e00 --- /dev/null +++ b/rest/api/v3/sso/.openapi-generator @@ -0,0 +1,64 @@ +.openapi-generator +.openapi-generator-ignore +README.md +api_create_sso_certificate.go +api_create_sso_integration.go +api_create_sso_teammate.go +api_delete_sso_certificate.go +api_delete_sso_integration.go +api_get_sso_certificate.go +api_get_sso_integration.go +api_list_sso_integration.go +api_list_sso_integration_certificate.go +api_service.go +api_update_sso_certificate.go +api_update_sso_integration.go +api_update_sso_teammate.go +docs/CreateSsoCertificate.md +docs/CreateSsoCertificateRequest.md +docs/CreateSsoIntegration.md +docs/CreateSsoTeammate.md +docs/DeleteSsoCertificate.md +docs/DeleteSsoIntegration.md +docs/GetSsoCertificate.md +docs/GetSsoIntegration.md +docs/ListSsoIntegration.md +docs/ListSsoIntegrationCertificate.md +docs/PatchSsoTeammates200.md +docs/PermissionType.md +docs/PermissionType1.md +docs/Persona.md +docs/PostPatchIntegrationRequest.md +docs/PostSsoTeammates201.md +docs/PostSsoTeammatesRequest.md +docs/SsoCertificateBody.md +docs/SsoErrorResponseInner.md +docs/SsoIntegration.md +docs/SsoTeammatesBaseRequestProps.md +docs/SsoTeammatesBaseRequestPropsSubuserAccessInner.md +docs/SsoTeammatesBaseResponseProps.md +docs/SsoTeammatesRestrictedSubuserResponseProps.md +docs/SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner.md +docs/UpdateSsoCertificate.md +docs/UpdateSsoCertificateRequest.md +docs/UpdateSsoIntegration.md +docs/UpdateSsoTeammate.md +docs/UserType.md +model_create_sso_certificate_request.go +model_patch_sso_teammates200.go +model_permission_type.go +model_permission_type1.go +model_persona.go +model_post_patch_integration_request.go +model_post_sso_teammates201.go +model_post_sso_teammates_request.go +model_sso_certificate_body.go +model_sso_error_response_inner.go +model_sso_integration.go +model_sso_teammates_base_request_props.go +model_sso_teammates_base_request_props_subuser_access_inner.go +model_sso_teammates_base_response_props.go +model_sso_teammates_restricted_subuser_response_props.go +model_sso_teammates_restricted_subuser_response_props_subuser_access_inner.go +model_update_sso_certificate_request.go +model_user_type.go diff --git a/rest/api/v3/sso/.openapi-generator-ignore b/rest/api/v3/sso/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/rest/api/v3/sso/.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/rest/api/v3/sso/README.md b/rest/api/v3/sso/README.md new file mode 100644 index 00000000..731a302f --- /dev/null +++ b/rest/api/v3/sso/README.md @@ -0,0 +1,94 @@ +# Go API client for + +The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). + +The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. + +The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. + +The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). + +## 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:44.437973+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 +------------ | ------------- | ------------- | ------------- +*CreateSsoCertificate* | [**CreateSsoCertificate**](docs/CreateSsoCertificate.md#createssocertificate) | **Post** /v3/sso/certificates | Create an SSO Certificate +*CreateSsoIntegration* | [**CreateSsoIntegration**](docs/CreateSsoIntegration.md#createssointegration) | **Post** /v3/sso/integrations | Create an SSO Integration +*CreateSsoTeammate* | [**CreateSsoTeammate**](docs/CreateSsoTeammate.md#createssoteammate) | **Post** /v3/sso/teammates | Create an SSO Teammate. +*DeleteSsoCertificate* | [**DeleteSsoCertificate**](docs/DeleteSsoCertificate.md#deletessocertificate) | **Delete** /v3/sso/certificates/{CertId} | Delete an SSO Certificate +*DeleteSsoIntegration* | [**DeleteSsoIntegration**](docs/DeleteSsoIntegration.md#deletessointegration) | **Delete** /v3/sso/integrations/{Id} | Delete an SSO Integration +*GetSsoCertificate* | [**GetSsoCertificate**](docs/GetSsoCertificate.md#getssocertificate) | **Get** /v3/sso/certificates/{CertId} | Get an SSO Certificate +*GetSsoIntegration* | [**GetSsoIntegration**](docs/GetSsoIntegration.md#getssointegration) | **Get** /v3/sso/integrations/{Id} | Get an SSO Integration +*ListSsoIntegration* | [**ListSsoIntegration**](docs/ListSsoIntegration.md#listssointegration) | **Get** /v3/sso/integrations | Get All SSO Integrations +*ListSsoIntegrationCertificate* | [**ListSsoIntegrationCertificate**](docs/ListSsoIntegrationCertificate.md#listssointegrationcertificate) | **Get** /v3/sso/integrations/{IntegrationId}/certificates | Get All SSO Certificates by Integration +*UpdateSsoCertificate* | [**UpdateSsoCertificate**](docs/UpdateSsoCertificate.md#updatessocertificate) | **Patch** /v3/sso/certificates/{CertId} | Update SSO Certificate +*UpdateSsoIntegration* | [**UpdateSsoIntegration**](docs/UpdateSsoIntegration.md#updatessointegration) | **Patch** /v3/sso/integrations/{Id} | Update an SSO Integration +*UpdateSsoTeammate* | [**UpdateSsoTeammate**](docs/UpdateSsoTeammate.md#updatessoteammate) | **Patch** /v3/sso/teammates/{Username} | Edit an SSO Teammate + + +## Documentation For Models + + - [CreateSsoCertificateRequest](CreateSsoCertificateRequest.md) + - [PatchSsoTeammates200](PatchSsoTeammates200.md) + - [PermissionType](PermissionType.md) + - [PermissionType1](PermissionType1.md) + - [Persona](Persona.md) + - [PostPatchIntegrationRequest](PostPatchIntegrationRequest.md) + - [PostSsoTeammates201](PostSsoTeammates201.md) + - [PostSsoTeammatesRequest](PostSsoTeammatesRequest.md) + - [SsoCertificateBody](SsoCertificateBody.md) + - [SsoErrorResponseInner](SsoErrorResponseInner.md) + - [SsoIntegration](SsoIntegration.md) + - [SsoTeammatesBaseRequestProps](SsoTeammatesBaseRequestProps.md) + - [SsoTeammatesBaseRequestPropsSubuserAccessInner](SsoTeammatesBaseRequestPropsSubuserAccessInner.md) + - [SsoTeammatesBaseResponseProps](SsoTeammatesBaseResponseProps.md) + - [SsoTeammatesRestrictedSubuserResponseProps](SsoTeammatesRestrictedSubuserResponseProps.md) + - [SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner](SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner.md) + - [UpdateSsoCertificateRequest](UpdateSsoCertificateRequest.md) + - [UserType](UserType.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) +``` + diff --git a/rest/api/v3/sso/api_create_sso_certificate.go b/rest/api/v3/sso/api_create_sso_certificate.go new file mode 100644 index 00000000..f23bc4dd --- /dev/null +++ b/rest/api/v3/sso/api_create_sso_certificate.go @@ -0,0 +1,104 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* 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 CreateSsoCertificateParam struct { + // + CreateSsoCertificateRequest *CreateSsoCertificateRequest `json:"CreateSsoCertificateRequest,omitempty"` +} + +func (params *CreateSsoCertificateParam) SetCreateSsoCertificateRequest(CreateSsoCertificateRequest CreateSsoCertificateRequest) *CreateSsoCertificateParam { + params.CreateSsoCertificateRequest = &CreateSsoCertificateRequest + return params +} + +// **This endpoint allows you to create an SSO certificate.** +func (c *ApiService) CreateSsoCertificate(params *CreateSsoCertificateParam) (interface{}, error) { + path := "/v3/sso/certificates" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.CreateSsoCertificateRequest != nil { + b, err := json.Marshal(*params.CreateSsoCertificateRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SsoCertificateBody{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/sso/api_create_sso_integration.go b/rest/api/v3/sso/api_create_sso_integration.go new file mode 100644 index 00000000..2113b4f5 --- /dev/null +++ b/rest/api/v3/sso/api_create_sso_integration.go @@ -0,0 +1,104 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* 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 CreateSsoIntegrationParam struct { + // + PostPatchIntegrationRequest *PostPatchIntegrationRequest `json:"PostPatchIntegrationRequest,omitempty"` +} + +func (params *CreateSsoIntegrationParam) SetPostPatchIntegrationRequest(PostPatchIntegrationRequest PostPatchIntegrationRequest) *CreateSsoIntegrationParam { + params.PostPatchIntegrationRequest = &PostPatchIntegrationRequest + return params +} + +// **This endpoint allows you to create an SSO integration.** +func (c *ApiService) CreateSsoIntegration(params *CreateSsoIntegrationParam) (interface{}, error) { + path := "/v3/sso/integrations" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.PostPatchIntegrationRequest != nil { + b, err := json.Marshal(*params.PostPatchIntegrationRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SsoIntegration{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/sso/api_create_sso_teammate.go b/rest/api/v3/sso/api_create_sso_teammate.go new file mode 100644 index 00000000..ac3f8c9b --- /dev/null +++ b/rest/api/v3/sso/api_create_sso_teammate.go @@ -0,0 +1,104 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* 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 CreateSsoTeammateParam struct { + // + PostSsoTeammatesRequest *PostSsoTeammatesRequest `json:"PostSsoTeammatesRequest,omitempty"` +} + +func (params *CreateSsoTeammateParam) SetPostSsoTeammatesRequest(PostSsoTeammatesRequest PostSsoTeammatesRequest) *CreateSsoTeammateParam { + params.PostSsoTeammatesRequest = &PostSsoTeammatesRequest + return params +} + +// **This endpoint allows you to create an SSO Teammate.** The email address provided for the Teammate will also function as the Teammate's username. Once created, the Teammate's email address cannot be changed. ### Scopes When creating a Teammate, you will assign it permissions or scopes. These scopes determine which actions the Teammate can perform and which features they can access. Scopes are provided with one of three properties passed to this endpoint: `is_admin`, `scopes`, and `persona`. You can make a Teammate an administrator by setting `is_admin` to `true`. Administrators will have all scopes assigned to them. Alternatively, you can assign a `persona` to the teammate, which will assign them a block of permissions commonly required for that type of user. See the \"Persona scopes\" section of [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions#persona-scopes) for a list of permsissions granted by persona. Lastly, you can assign individual permissions with the `scopes` property. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a full list of scopes that can be assigned to a Teammate. ### Subuser access SendGrid Teammates may be assigned access to one or more Subusers. Subusers function like SendGrid sub-accounts with their own resources. See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. When assigning Subuser access to a Teammate, you may set the `has_restricted_subuser_access` property to `true` to constrain the Teammate so that they can operate only on behalf of the Subusers to which they are assigned. You may further set the level of access the Teammate has to each Subuser with the `subuser_access` property. +func (c *ApiService) CreateSsoTeammate(params *CreateSsoTeammateParam) (interface{}, error) { + path := "/v3/sso/teammates" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.PostSsoTeammatesRequest != nil { + b, err := json.Marshal(*params.PostSsoTeammatesRequest) + if err != nil { + return nil, err + } + body = b + } + + 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 := &PostSsoTeammates201{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/sso/api_delete_sso_certificate.go b/rest/api/v3/sso/api_delete_sso_certificate.go new file mode 100644 index 00000000..4deeb0a5 --- /dev/null +++ b/rest/api/v3/sso/api_delete_sso_certificate.go @@ -0,0 +1,100 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* 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" + + "strings" +) + +type DeleteSsoCertificateParam struct { + // + CertId *string `json:"cert_id"` +} + +func (params *DeleteSsoCertificateParam) SetCertId(CertId string) *DeleteSsoCertificateParam { + params.CertId = &CertId + return params +} + +// **This endpoint allows you to delete an SSO certificate.** You can retrieve a certificate's ID from the response provided by the \"Get All SSO Integrations\" endpoint. +func (c *ApiService) DeleteSsoCertificate(params *DeleteSsoCertificateParam) (interface{}, error) { + path := "/v3/sso/certificates/{CertId}" + if params != nil && params.CertId != nil { + path = strings.Replace(path, "{"+"CertId"+"}", *params.CertId, -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() + if resp.StatusCode == 200 { + ps := &SsoCertificateBody{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/sso/api_delete_sso_integration.go b/rest/api/v3/sso/api_delete_sso_integration.go new file mode 100644 index 00000000..fd63f994 --- /dev/null +++ b/rest/api/v3/sso/api_delete_sso_integration.go @@ -0,0 +1,92 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* 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" + + "strings" +) + +type DeleteSsoIntegrationParam struct { + // + Id *string `json:"id"` +} + +func (params *DeleteSsoIntegrationParam) SetId(Id string) *DeleteSsoIntegrationParam { + params.Id = &Id + return params +} + +// **This endpoint allows you to delete an IdP configuration by ID.** You can retrieve the IDs for your configurations from the response provided by the \"Get All SSO Integrations\" endpoint. +func (c *ApiService) DeleteSsoIntegration(params *DeleteSsoIntegrationParam) (interface{}, error) { + path := "/v3/sso/integrations/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -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() + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/sso/api_get_sso_certificate.go b/rest/api/v3/sso/api_get_sso_certificate.go new file mode 100644 index 00000000..81234a78 --- /dev/null +++ b/rest/api/v3/sso/api_get_sso_certificate.go @@ -0,0 +1,100 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* 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" + + "strings" +) + +type GetSsoCertificateParam struct { + // + CertId *string `json:"cert_id"` +} + +func (params *GetSsoCertificateParam) SetCertId(CertId string) *GetSsoCertificateParam { + params.CertId = &CertId + return params +} + +// **This endpoint allows you to retrieve an individual SSO certificate.** +func (c *ApiService) GetSsoCertificate(params *GetSsoCertificateParam) (interface{}, error) { + path := "/v3/sso/certificates/{CertId}" + if params != nil && params.CertId != nil { + path = strings.Replace(path, "{"+"CertId"+"}", *params.CertId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SsoCertificateBody{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/sso/api_get_sso_integration.go b/rest/api/v3/sso/api_get_sso_integration.go new file mode 100644 index 00000000..4ada401b --- /dev/null +++ b/rest/api/v3/sso/api_get_sso_integration.go @@ -0,0 +1,111 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/url" + + "strings" +) + +type GetSsoIntegrationParam struct { + // + Id *string `json:"id"` + // If this parameter is set to `true`, the response will include the `completed_integration` field. + Si *bool `json:"si,omitempty"` +} + +func (params *GetSsoIntegrationParam) SetId(Id string) *GetSsoIntegrationParam { + params.Id = &Id + return params +} +func (params *GetSsoIntegrationParam) SetSi(Si bool) *GetSsoIntegrationParam { + params.Si = &Si + return params +} + +// **This endpoint allows you to retrieve an SSO integration by ID.** You can retrieve the IDs for your configurations from the response provided by the \"Get All SSO Integrations\" endpoint. +func (c *ApiService) GetSsoIntegration(params *GetSsoIntegrationParam) (interface{}, error) { + path := "/v3/sso/integrations/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Si != nil { + data.Set("si", fmt.Sprint(*params.Si)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SsoIntegration{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/sso/api_list_sso_integration.go b/rest/api/v3/sso/api_list_sso_integration.go new file mode 100644 index 00000000..9e89db77 --- /dev/null +++ b/rest/api/v3/sso/api_list_sso_integration.go @@ -0,0 +1,100 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/url" +) + +type ListSsoIntegrationParam struct { + // If this parameter is set to `true`, the response will include the `completed_integration` field. + Si *bool `json:"si,omitempty"` +} + +func (params *ListSsoIntegrationParam) SetSi(Si bool) *ListSsoIntegrationParam { + params.Si = &Si + return params +} + +// **This endpoint allows you to retrieve all SSO integrations tied to your Twilio SendGrid account.** The IDs returned by this endpoint can be used by the APIs additional endpoints to modify your SSO integrations. +func (c *ApiService) ListSsoIntegration(params *ListSsoIntegrationParam) (interface{}, error) { + path := "/v3/sso/integrations" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Si != nil { + data.Set("si", fmt.Sprint(*params.Si)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]SsoIntegration{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/sso/api_list_sso_integration_certificate.go b/rest/api/v3/sso/api_list_sso_integration_certificate.go new file mode 100644 index 00000000..4086e929 --- /dev/null +++ b/rest/api/v3/sso/api_list_sso_integration_certificate.go @@ -0,0 +1,100 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* 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" + + "strings" +) + +type ListSsoIntegrationCertificateParam struct { + // An ID that matches a certificate to a specific IdP integration. + IntegrationId *string `json:"integration_id"` +} + +func (params *ListSsoIntegrationCertificateParam) SetIntegrationId(IntegrationId string) *ListSsoIntegrationCertificateParam { + params.IntegrationId = &IntegrationId + return params +} + +// **This endpoint allows you to retrieve all your IdP configurations by configuration ID.** The `integration_id` expected by this endpoint is the `id` returned in the response by the \"Get All SSO Integrations\" endpoint. +func (c *ApiService) ListSsoIntegrationCertificate(params *ListSsoIntegrationCertificateParam) (interface{}, error) { + path := "/v3/sso/integrations/{IntegrationId}/certificates" + if params != nil && params.IntegrationId != nil { + path = strings.Replace(path, "{"+"IntegrationId"+"}", *params.IntegrationId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]SsoCertificateBody{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/sso/api_service.go b/rest/api/v3/sso/api_service.go new file mode 100644 index 00000000..1564dab4 --- /dev/null +++ b/rest/api/v3/sso/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/sso/api_update_sso_certificate.go b/rest/api/v3/sso/api_update_sso_certificate.go new file mode 100644 index 00000000..58803890 --- /dev/null +++ b/rest/api/v3/sso/api_update_sso_certificate.go @@ -0,0 +1,115 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* 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" + + "strings" +) + +type UpdateSsoCertificateParam struct { + // + CertId *string `json:"cert_id"` + // + UpdateSsoCertificateRequest *UpdateSsoCertificateRequest `json:"UpdateSsoCertificateRequest,omitempty"` +} + +func (params *UpdateSsoCertificateParam) SetCertId(CertId string) *UpdateSsoCertificateParam { + params.CertId = &CertId + return params +} +func (params *UpdateSsoCertificateParam) SetUpdateSsoCertificateRequest(UpdateSsoCertificateRequest UpdateSsoCertificateRequest) *UpdateSsoCertificateParam { + params.UpdateSsoCertificateRequest = &UpdateSsoCertificateRequest + return params +} + +// **This endpoint allows you to update an existing certificate by ID.** You can retrieve a certificate's ID from the response provided by the \"Get All SSO Integrations\" endpoint. +func (c *ApiService) UpdateSsoCertificate(params *UpdateSsoCertificateParam) (interface{}, error) { + path := "/v3/sso/certificates/{CertId}" + if params != nil && params.CertId != nil { + path = strings.Replace(path, "{"+"CertId"+"}", *params.CertId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateSsoCertificateRequest != nil { + b, err := json.Marshal(*params.UpdateSsoCertificateRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SsoCertificateBody{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/sso/api_update_sso_integration.go b/rest/api/v3/sso/api_update_sso_integration.go new file mode 100644 index 00000000..5a8f9639 --- /dev/null +++ b/rest/api/v3/sso/api_update_sso_integration.go @@ -0,0 +1,125 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/url" + + "strings" +) + +type UpdateSsoIntegrationParam struct { + // + Id *string `json:"id"` + // If this parameter is set to `true`, the response will include the `completed_integration` field. + Si *bool `json:"si,omitempty"` + // + PostPatchIntegrationRequest *PostPatchIntegrationRequest `json:"PostPatchIntegrationRequest,omitempty"` +} + +func (params *UpdateSsoIntegrationParam) SetId(Id string) *UpdateSsoIntegrationParam { + params.Id = &Id + return params +} +func (params *UpdateSsoIntegrationParam) SetSi(Si bool) *UpdateSsoIntegrationParam { + params.Si = &Si + return params +} +func (params *UpdateSsoIntegrationParam) SetPostPatchIntegrationRequest(PostPatchIntegrationRequest PostPatchIntegrationRequest) *UpdateSsoIntegrationParam { + params.PostPatchIntegrationRequest = &PostPatchIntegrationRequest + return params +} + +// **This endpoint allows you to modify an exisiting SSO integration.** You can retrieve the IDs for your configurations from the response provided by the \"Get All SSO Integrations\" endpoint. +func (c *ApiService) UpdateSsoIntegration(params *UpdateSsoIntegrationParam) (interface{}, error) { + path := "/v3/sso/integrations/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + if params != nil && params.Si != nil { + data.Set("si", fmt.Sprint(*params.Si)) + } + body := []byte{} + if params != nil && params.PostPatchIntegrationRequest != nil { + b, err := json.Marshal(*params.PostPatchIntegrationRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SsoIntegration{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/sso/api_update_sso_teammate.go b/rest/api/v3/sso/api_update_sso_teammate.go new file mode 100644 index 00000000..af816bea --- /dev/null +++ b/rest/api/v3/sso/api_update_sso_teammate.go @@ -0,0 +1,115 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* 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" + + "strings" +) + +type UpdateSsoTeammateParam struct { + // Set this parameter to the Teammate's email address. This address must be the same address assigned to the Teammate in your IdP. + Username *string `json:"username"` + // + Body *SsoTeammatesBaseRequestProps `json:"body,omitempty"` +} + +func (params *UpdateSsoTeammateParam) SetUsername(Username string) *UpdateSsoTeammateParam { + params.Username = &Username + return params +} +func (params *UpdateSsoTeammateParam) SetBody(Body SsoTeammatesBaseRequestProps) *UpdateSsoTeammateParam { + params.Body = &Body + return params +} + +// **This endpoint allows you to modify an existing SSO Teammate.** Only the parent user and Teammates with admin permissions can update another Teammate's permissions. ### Scopes When updating a Teammate, you will assign it permissions or scopes. These scopes determine which actions the Teammate can perform and which features they can access. Scopes are provided with one of three properties passed to this endpoint: `is_admin`, `scopes`, and `persona`. You can make a Teammate an administrator by setting `is_admin` to `true`. Administrators will have all scopes assigned to them. Alternatively, you can assign a `persona` to the teammate, which will assign them a block of permissions commonly required for that type of user. See the \"Persona scopes\" section of [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions#persona-scopes) for a list of permsissions granted by persona. Lastly, you can assign individual permissions with the `scopes` property. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a full list of scopes that can be assigned to a Teammate. ### Subuser access SendGrid Teammates may be assigned access to one or more Subusers. Subusers function like SendGrid sub-accounts with their own resources. See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. When assigning Subuser access to a Teammate, you may set the `has_restricted_subuser_access` property to `true` to constrain the Teammate so that they can operate only on behalf of the Subusers to which they are assigned. You may further set the level of access the Teammate has to each Subuser with the `subuser_access` property. +func (c *ApiService) UpdateSsoTeammate(params *UpdateSsoTeammateParam) (interface{}, error) { + path := "/v3/sso/teammates/{Username}" + if params != nil && params.Username != nil { + path = strings.Replace(path, "{"+"Username"+"}", *params.Username, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.Body != nil { + b, err := json.Marshal(*params.Body) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &PatchSsoTeammates200{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/sso/docs/CreateSsoCertificate.md b/rest/api/v3/sso/docs/CreateSsoCertificate.md new file mode 100644 index 00000000..0f1b57e1 --- /dev/null +++ b/rest/api/v3/sso/docs/CreateSsoCertificate.md @@ -0,0 +1,48 @@ +# CreateSsoCertificate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateSsoCertificate**](CreateSsoCertificate.md#CreateSsoCertificate) | **Post** /v3/sso/certificates | Create an SSO Certificate + + + +## CreateSsoCertificate + +> SsoCertificateBody CreateSsoCertificate(ctx, optional) + +Create an SSO Certificate + +**This endpoint allows you to create an SSO certificate.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateSsoCertificateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**CreateSsoCertificateRequest** | [**CreateSsoCertificateRequest**](CreateSsoCertificateRequest.md) | + +### Return type + +[**SsoCertificateBody**](SsoCertificateBody.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/sso/docs/CreateSsoCertificateRequest.md b/rest/api/v3/sso/docs/CreateSsoCertificateRequest.md new file mode 100644 index 00000000..ff047454 --- /dev/null +++ b/rest/api/v3/sso/docs/CreateSsoCertificateRequest.md @@ -0,0 +1,13 @@ +# CreateSsoCertificateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PublicCertificate** | **string** | This public certificate allows SendGrid to verify that SAML requests it receives are signed by an IdP that it recognizes. | +**Enabled** | **bool** | Indicates if the certificate is enabled. |[optional] +**IntegrationId** | **string** | An ID that matches a certificate to a specific IdP integration. This is the `id` returned by the \"Get All SSO Integrations\" endpoint. | + +[[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/rest/api/v3/sso/docs/CreateSsoIntegration.md b/rest/api/v3/sso/docs/CreateSsoIntegration.md new file mode 100644 index 00000000..cc6926e3 --- /dev/null +++ b/rest/api/v3/sso/docs/CreateSsoIntegration.md @@ -0,0 +1,48 @@ +# CreateSsoIntegration + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateSsoIntegration**](CreateSsoIntegration.md#CreateSsoIntegration) | **Post** /v3/sso/integrations | Create an SSO Integration + + + +## CreateSsoIntegration + +> SsoIntegration CreateSsoIntegration(ctx, optional) + +Create an SSO Integration + +**This endpoint allows you to create an SSO integration.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateSsoIntegrationParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**PostPatchIntegrationRequest** | [**PostPatchIntegrationRequest**](PostPatchIntegrationRequest.md) | + +### Return type + +[**SsoIntegration**](SsoIntegration.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/sso/docs/CreateSsoTeammate.md b/rest/api/v3/sso/docs/CreateSsoTeammate.md new file mode 100644 index 00000000..98907b69 --- /dev/null +++ b/rest/api/v3/sso/docs/CreateSsoTeammate.md @@ -0,0 +1,48 @@ +# CreateSsoTeammate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateSsoTeammate**](CreateSsoTeammate.md#CreateSsoTeammate) | **Post** /v3/sso/teammates | Create an SSO Teammate. + + + +## CreateSsoTeammate + +> PostSsoTeammates201 CreateSsoTeammate(ctx, optional) + +Create an SSO Teammate. + +**This endpoint allows you to create an SSO Teammate.** The email address provided for the Teammate will also function as the Teammate's username. Once created, the Teammate's email address cannot be changed. ### Scopes When creating a Teammate, you will assign it permissions or scopes. These scopes determine which actions the Teammate can perform and which features they can access. Scopes are provided with one of three properties passed to this endpoint: `is_admin`, `scopes`, and `persona`. You can make a Teammate an administrator by setting `is_admin` to `true`. Administrators will have all scopes assigned to them. Alternatively, you can assign a `persona` to the teammate, which will assign them a block of permissions commonly required for that type of user. See the \"Persona scopes\" section of [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions#persona-scopes) for a list of permsissions granted by persona. Lastly, you can assign individual permissions with the `scopes` property. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a full list of scopes that can be assigned to a Teammate. ### Subuser access SendGrid Teammates may be assigned access to one or more Subusers. Subusers function like SendGrid sub-accounts with their own resources. See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. When assigning Subuser access to a Teammate, you may set the `has_restricted_subuser_access` property to `true` to constrain the Teammate so that they can operate only on behalf of the Subusers to which they are assigned. You may further set the level of access the Teammate has to each Subuser with the `subuser_access` property. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateSsoTeammateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**PostSsoTeammatesRequest** | [**PostSsoTeammatesRequest**](PostSsoTeammatesRequest.md) | + +### Return type + +[**PostSsoTeammates201**](PostSsoTeammates201.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/sso/docs/DeleteSsoCertificate.md b/rest/api/v3/sso/docs/DeleteSsoCertificate.md new file mode 100644 index 00000000..27eba6d0 --- /dev/null +++ b/rest/api/v3/sso/docs/DeleteSsoCertificate.md @@ -0,0 +1,51 @@ +# DeleteSsoCertificate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteSsoCertificate**](DeleteSsoCertificate.md#DeleteSsoCertificate) | **Delete** /v3/sso/certificates/{CertId} | Delete an SSO Certificate + + + +## DeleteSsoCertificate + +> SsoCertificateBody DeleteSsoCertificate(ctx, CertId) + +Delete an SSO Certificate + +**This endpoint allows you to delete an SSO certificate.** You can retrieve a certificate's ID from the response provided by the \"Get All SSO Integrations\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**CertId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteSsoCertificateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**SsoCertificateBody**](SsoCertificateBody.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/sso/docs/DeleteSsoIntegration.md b/rest/api/v3/sso/docs/DeleteSsoIntegration.md new file mode 100644 index 00000000..d9961b65 --- /dev/null +++ b/rest/api/v3/sso/docs/DeleteSsoIntegration.md @@ -0,0 +1,51 @@ +# DeleteSsoIntegration + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteSsoIntegration**](DeleteSsoIntegration.md#DeleteSsoIntegration) | **Delete** /v3/sso/integrations/{Id} | Delete an SSO Integration + + + +## DeleteSsoIntegration + +> DeleteSsoIntegration(ctx, Id) + +Delete an SSO Integration + +**This endpoint allows you to delete an IdP configuration by ID.** You can retrieve the IDs for your configurations from the response provided by the \"Get All SSO Integrations\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteSsoIntegrationParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/sso/docs/GetSsoCertificate.md b/rest/api/v3/sso/docs/GetSsoCertificate.md new file mode 100644 index 00000000..e6ecfde7 --- /dev/null +++ b/rest/api/v3/sso/docs/GetSsoCertificate.md @@ -0,0 +1,51 @@ +# GetSsoCertificate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetSsoCertificate**](GetSsoCertificate.md#GetSsoCertificate) | **Get** /v3/sso/certificates/{CertId} | Get an SSO Certificate + + + +## GetSsoCertificate + +> SsoCertificateBody GetSsoCertificate(ctx, CertId) + +Get an SSO Certificate + +**This endpoint allows you to retrieve an individual SSO certificate.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**CertId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a GetSsoCertificateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**SsoCertificateBody**](SsoCertificateBody.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/sso/docs/GetSsoIntegration.md b/rest/api/v3/sso/docs/GetSsoIntegration.md new file mode 100644 index 00000000..ea49cd71 --- /dev/null +++ b/rest/api/v3/sso/docs/GetSsoIntegration.md @@ -0,0 +1,52 @@ +# GetSsoIntegration + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetSsoIntegration**](GetSsoIntegration.md#GetSsoIntegration) | **Get** /v3/sso/integrations/{Id} | Get an SSO Integration + + + +## GetSsoIntegration + +> SsoIntegration GetSsoIntegration(ctx, Idoptional) + +Get an SSO Integration + +**This endpoint allows you to retrieve an SSO integration by ID.** You can retrieve the IDs for your configurations from the response provided by the \"Get All SSO Integrations\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a GetSsoIntegrationParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Si** | **bool** | If this parameter is set to `true`, the response will include the `completed_integration` field. + +### Return type + +[**SsoIntegration**](SsoIntegration.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/sso/docs/ListSsoIntegration.md b/rest/api/v3/sso/docs/ListSsoIntegration.md new file mode 100644 index 00000000..8082cbe7 --- /dev/null +++ b/rest/api/v3/sso/docs/ListSsoIntegration.md @@ -0,0 +1,48 @@ +# ListSsoIntegration + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListSsoIntegration**](ListSsoIntegration.md#ListSsoIntegration) | **Get** /v3/sso/integrations | Get All SSO Integrations + + + +## ListSsoIntegration + +> []SsoIntegration ListSsoIntegration(ctx, optional) + +Get All SSO Integrations + +**This endpoint allows you to retrieve all SSO integrations tied to your Twilio SendGrid account.** The IDs returned by this endpoint can be used by the APIs additional endpoints to modify your SSO integrations. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListSsoIntegrationParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Si** | **bool** | If this parameter is set to `true`, the response will include the `completed_integration` field. + +### Return type + +[**[]SsoIntegration**](SsoIntegration.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/sso/docs/ListSsoIntegrationCertificate.md b/rest/api/v3/sso/docs/ListSsoIntegrationCertificate.md new file mode 100644 index 00000000..526ad85d --- /dev/null +++ b/rest/api/v3/sso/docs/ListSsoIntegrationCertificate.md @@ -0,0 +1,51 @@ +# ListSsoIntegrationCertificate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListSsoIntegrationCertificate**](ListSsoIntegrationCertificate.md#ListSsoIntegrationCertificate) | **Get** /v3/sso/integrations/{IntegrationId}/certificates | Get All SSO Certificates by Integration + + + +## ListSsoIntegrationCertificate + +> []SsoCertificateBody ListSsoIntegrationCertificate(ctx, IntegrationId) + +Get All SSO Certificates by Integration + +**This endpoint allows you to retrieve all your IdP configurations by configuration ID.** The `integration_id` expected by this endpoint is the `id` returned in the response by the \"Get All SSO Integrations\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**IntegrationId** | **string** | An ID that matches a certificate to a specific IdP integration. + +### Other Parameters + +Other parameters are passed through a pointer to a ListSsoIntegrationCertificateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**[]SsoCertificateBody**](SsoCertificateBody.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/sso/docs/PatchSsoTeammates200.md b/rest/api/v3/sso/docs/PatchSsoTeammates200.md new file mode 100644 index 00000000..b1b277d5 --- /dev/null +++ b/rest/api/v3/sso/docs/PatchSsoTeammates200.md @@ -0,0 +1,29 @@ +# PatchSsoTeammates200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | **string** | The Teammate's street address. |[optional] +**Address2** | **string** | The Teammate's apartment number, suite number, or other secondary address information that is not part of the physical street address. |[optional] +**City** | **string** | The Teammate's city. |[optional] +**Company** | **string** | The Teammate's company name. |[optional] +**Country** | **string** | The Teammate's country of residence. |[optional] +**Username** | **string** | The Teammate's username. This property is set to the Teammate's email address. |[optional] +**Phone** | **string** | The Teammate's phone number. |[optional] +**State** | **string** | The Teammate's state or province. |[optional] +**UserType** | [**UserType**](UserType.md) | A Teammate can be an `admin`, `owner`, or `teammate`. Each role is associated with the scope of the Teammate's permissions. |[optional] +**Website** | **string** | A website associated with the Teammate. |[optional] +**Zip** | **string** | The Teammate's zip code. |[optional] +**FirstName** | **string** | The Teammate's first name. |[optional] +**LastName** | **string** | The Teammate's last name. |[optional] +**Email** | **string** | Teammate's email address. This email address also functions as the Teammate's username and must match the address assigned to the user in your IdP. This address cannot be changed after the Teammate is created. |[optional] +**IsAdmin** | **bool** | Indicates if the Teammate has administrator permissions. When set to `true`, the Teammate is an admin. |[optional] +**IsSso** | **bool** | Indicates how the Teammate authenticates with SendGrid. When set to `true`, the Teammate will access SendGrid via SSO and their IdP. When set to `false`, the Teammate will authenticate directly with SendGrid via a username and password. |[optional] +**Scopes** | **[]string** | The permissions or scopes currently assigned to the Teammate. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. |[optional] +**HasRestrictedSubuserAccess** | **bool** | When this property is set to `true`, the Teammate has permissions to operate only on behalf of a Subuser. This property value is `true` when the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. |[optional] +**SubuserAccess** | [**[]SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner**](SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner.md) | Specifies which Subusers the Teammate may access and act on behalf of. If this property is populated, the `has_restricted_subuser_access` property will be `true`. |[optional] + +[[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/rest/api/v3/sso/docs/PermissionType.md b/rest/api/v3/sso/docs/PermissionType.md new file mode 100644 index 00000000..da44f853 --- /dev/null +++ b/rest/api/v3/sso/docs/PermissionType.md @@ -0,0 +1,13 @@ +# PermissionType + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**ADMIN** | string | (value: `"admin"`) +**RESTRICTED** | string | (value: `"restricted"`) + + +[[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/rest/api/v3/sso/docs/PermissionType1.md b/rest/api/v3/sso/docs/PermissionType1.md new file mode 100644 index 00000000..5fa3bbb8 --- /dev/null +++ b/rest/api/v3/sso/docs/PermissionType1.md @@ -0,0 +1,13 @@ +# PermissionType1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**ADMIN** | string | (value: `"admin"`) +**RESTRICTED** | string | (value: `"restricted"`) + + +[[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/rest/api/v3/sso/docs/Persona.md b/rest/api/v3/sso/docs/Persona.md new file mode 100644 index 00000000..a422b3d2 --- /dev/null +++ b/rest/api/v3/sso/docs/Persona.md @@ -0,0 +1,15 @@ +# Persona + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**ACCOUNTANT** | string | (value: `"accountant"`) +**DEVELOPER** | string | (value: `"developer"`) +**MARKETER** | string | (value: `"marketer"`) +**OBSERVER** | string | (value: `"observer"`) + + +[[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/rest/api/v3/sso/docs/PostPatchIntegrationRequest.md b/rest/api/v3/sso/docs/PostPatchIntegrationRequest.md new file mode 100644 index 00000000..813db37b --- /dev/null +++ b/rest/api/v3/sso/docs/PostPatchIntegrationRequest.md @@ -0,0 +1,16 @@ +# PostPatchIntegrationRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of your integration. This name can be anything that makes sense for your organization (eg. Twilio SendGrid) | +**Enabled** | **bool** | Indicates if the integration is enabled. | +**SigninUrl** | **string** | The IdP's SAML POST endpoint. This endpoint should receive requests and initiate an SSO login flow. This is called the \"Embed Link\" in the Twilio SendGrid UI. | +**SignoutUrl** | **string** | This URL is relevant only for an IdP-initiated authentication flow. If a user authenticates from their IdP, this URL will return them to their IdP when logging out. | +**EntityId** | **string** | An identifier provided by your IdP to identify Twilio SendGrid in the SAML interaction. This is called the \"SAML Issuer ID\" in the Twilio SendGrid UI. | +**CompletedIntegration** | **bool** | Indicates if the integration is complete. |[optional] + +[[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/rest/api/v3/sso/docs/PostSsoTeammates201.md b/rest/api/v3/sso/docs/PostSsoTeammates201.md new file mode 100644 index 00000000..90d13d83 --- /dev/null +++ b/rest/api/v3/sso/docs/PostSsoTeammates201.md @@ -0,0 +1,18 @@ +# PostSsoTeammates201 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FirstName** | **string** | The Teammate's first name. |[optional] +**LastName** | **string** | The Teammate's last name. |[optional] +**Email** | **string** | Teammate's email address. This email address also functions as the Teammate's username and must match the address assigned to the user in your IdP. This address cannot be changed after the Teammate is created. |[optional] +**IsAdmin** | **bool** | Indicates if the Teammate has administrator permissions. When set to `true`, the Teammate is an admin. |[optional] +**IsSso** | **bool** | Indicates how the Teammate authenticates with SendGrid. When set to `true`, the Teammate will access SendGrid via SSO and their IdP. When set to `false`, the Teammate will authenticate directly with SendGrid via a username and password. |[optional] +**Scopes** | **[]string** | The permissions or scopes currently assigned to the Teammate. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. |[optional] +**HasRestrictedSubuserAccess** | **bool** | When this property is set to `true`, the Teammate has permissions to operate only on behalf of a Subuser. This property value is `true` when the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. |[optional] +**SubuserAccess** | [**[]SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner**](SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner.md) | Specifies which Subusers the Teammate may access and act on behalf of. If this property is populated, the `has_restricted_subuser_access` property will be `true`. |[optional] + +[[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/rest/api/v3/sso/docs/PostSsoTeammatesRequest.md b/rest/api/v3/sso/docs/PostSsoTeammatesRequest.md new file mode 100644 index 00000000..ef110ee3 --- /dev/null +++ b/rest/api/v3/sso/docs/PostSsoTeammatesRequest.md @@ -0,0 +1,18 @@ +# PostSsoTeammatesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | Set this property to the Teammate's email address. This email address will also function as the Teammate's username and must match the address assigned to the user in your IdP. This address cannot be changed after the Teammate is created. | +**FirstName** | **string** | Set this property to the Teammate's first name. | +**LastName** | **string** | Set this property to the Teammate's last name. | +**IsAdmin** | **bool** | Set this property to `true` if the Teammate has admin permissions. You should not include the `scopes` or `persona` properties when setting the `is_admin` property to `true`—an admin will be allocated all scopes. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of scopes. |[optional] +**Persona** | [**Persona**](Persona.md) | A persona represents a group of permissions often required by a type of Teammate such as a developer or marketer. Assigning a persona allows you to allocate a group of pre-defined permissions rather than assigning each scope individually. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a full list of the scopes assigned to each persona. |[optional] +**Scopes** | **[]string** | Add or remove permissions from a Teammate using this `scopes` property. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. You should not include this propety in the request when using the `persona` property or when setting the `is_admin` property to `true`—assigning a `persona` or setting `is_admin` to `true` will allocate a group of permissions to the Teammate. |[optional] +**HasRestrictedSubuserAccess** | **bool** | Set this property to `true` to give the Teammate permissions to operate only on behalf of a Subuser. This property value must be `true` if the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. If this property is set to `true`, you cannot specify individual `scopes`, assign a `persona`, or set `is_admin` to `true`—a Teammate cannot specify scopes for the parent account and have restricted Subuser access. |[optional] +**SubuserAccess** | [**[]SsoTeammatesBaseRequestPropsSubuserAccessInner**](SsoTeammatesBaseRequestPropsSubuserAccessInner.md) | Specify which Subusers the Teammate may access and act on behalf of with this property. If this property is populated, you must set the `has_restricted_subuser_access` property to `true`. |[optional] + +[[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/rest/api/v3/sso/docs/SsoCertificateBody.md b/rest/api/v3/sso/docs/SsoCertificateBody.md new file mode 100644 index 00000000..68cb6289 --- /dev/null +++ b/rest/api/v3/sso/docs/SsoCertificateBody.md @@ -0,0 +1,15 @@ +# SsoCertificateBody + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PublicCertificate** | **string** | This certificate is used by Twilio SendGrid to verify that SAML requests are coming from Okta. This is called the X509 certificate in the Twilio SendGrid UI. |[optional] +**Id** | **float32** | A unique ID assigned to the certificate by SendGrid. |[optional] +**NotBefore** | **float32** | A unix timestamp (e.g., 1603915954) that indicates the time before which the certificate is not valid. |[optional] +**NotAfter** | **float32** | A unix timestamp (e.g., 1603915954) that indicates the time after which the certificate is no longer valid. |[optional] +**IntergrationId** | **string** | An ID that matches a certificate to a specific IdP integration. |[optional] + +[[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/rest/api/v3/sso/docs/SsoErrorResponseInner.md b/rest/api/v3/sso/docs/SsoErrorResponseInner.md new file mode 100644 index 00000000..df959452 --- /dev/null +++ b/rest/api/v3/sso/docs/SsoErrorResponseInner.md @@ -0,0 +1,13 @@ +# SsoErrorResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | |[optional] +**Field** | **string** | |[optional] +**ErrorId** | **string** | |[optional] + +[[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/rest/api/v3/sso/docs/SsoIntegration.md b/rest/api/v3/sso/docs/SsoIntegration.md new file mode 100644 index 00000000..aa5f45f8 --- /dev/null +++ b/rest/api/v3/sso/docs/SsoIntegration.md @@ -0,0 +1,20 @@ +# SsoIntegration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of your integration. This name can be anything that makes sense for your organization (eg. Twilio SendGrid) | +**Enabled** | **bool** | Indicates if the integration is enabled. | +**SigninUrl** | **string** | The IdP's SAML POST endpoint. This endpoint should receive requests and initiate an SSO login flow. This is called the \"Embed Link\" in the Twilio SendGrid UI. | +**SignoutUrl** | **string** | This URL is relevant only for an IdP-initiated authentication flow. If a user authenticates from their IdP, this URL will return them to their IdP when logging out. | +**EntityId** | **string** | An identifier provided by your IdP to identify Twilio SendGrid in the SAML interaction. This is called the \"SAML Issuer ID\" in the Twilio SendGrid UI. | +**CompletedIntegration** | **bool** | Indicates if the integration is complete. |[optional] +**LastUpdated** | **float32** | A timestamp representing the last time the configuration was modified. | +**Id** | **string** | A unique ID assigned to the configuration by SendGrid. |[optional] +**SingleSignonUrl** | **string** | The URL where your IdP should POST its SAML response. This is the Twilio SendGrid URL that is responsible for receiving and parsing a SAML assertion. This is the same URL as the Audience URL when using SendGrid. |[optional] +**AudienceUrl** | **string** | The URL where your IdP should POST its SAML response. This is the Twilio SendGrid URL that is responsible for receiving and parsing a SAML assertion. This is the same URL as the Single Sign-On URL when using SendGrid. |[optional] + +[[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/rest/api/v3/sso/docs/SsoTeammatesBaseRequestProps.md b/rest/api/v3/sso/docs/SsoTeammatesBaseRequestProps.md new file mode 100644 index 00000000..fcededd9 --- /dev/null +++ b/rest/api/v3/sso/docs/SsoTeammatesBaseRequestProps.md @@ -0,0 +1,17 @@ +# SsoTeammatesBaseRequestProps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FirstName** | **string** | Set this property to the Teammate's first name. | +**LastName** | **string** | Set this property to the Teammate's last name. | +**IsAdmin** | **bool** | Set this property to `true` if the Teammate has admin permissions. You should not include the `scopes` or `persona` properties when setting the `is_admin` property to `true`—an admin will be allocated all scopes. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of scopes. |[optional] +**Persona** | [**Persona**](Persona.md) | A persona represents a group of permissions often required by a type of Teammate such as a developer or marketer. Assigning a persona allows you to allocate a group of pre-defined permissions rather than assigning each scope individually. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a full list of the scopes assigned to each persona. |[optional] +**Scopes** | **[]string** | Add or remove permissions from a Teammate using this `scopes` property. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. You should not include this propety in the request when using the `persona` property or when setting the `is_admin` property to `true`—assigning a `persona` or setting `is_admin` to `true` will allocate a group of permissions to the Teammate. |[optional] +**HasRestrictedSubuserAccess** | **bool** | Set this property to `true` to give the Teammate permissions to operate only on behalf of a Subuser. This property value must be `true` if the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. If this property is set to `true`, you cannot specify individual `scopes`, assign a `persona`, or set `is_admin` to `true`—a Teammate cannot specify scopes for the parent account and have restricted Subuser access. |[optional] +**SubuserAccess** | [**[]SsoTeammatesBaseRequestPropsSubuserAccessInner**](SsoTeammatesBaseRequestPropsSubuserAccessInner.md) | Specify which Subusers the Teammate may access and act on behalf of with this property. If this property is populated, you must set the `has_restricted_subuser_access` property to `true`. |[optional] + +[[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/rest/api/v3/sso/docs/SsoTeammatesBaseRequestPropsSubuserAccessInner.md b/rest/api/v3/sso/docs/SsoTeammatesBaseRequestPropsSubuserAccessInner.md new file mode 100644 index 00000000..80c452b4 --- /dev/null +++ b/rest/api/v3/sso/docs/SsoTeammatesBaseRequestPropsSubuserAccessInner.md @@ -0,0 +1,13 @@ +# SsoTeammatesBaseRequestPropsSubuserAccessInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | Set this property to the ID of a Subuser to which the Teammate should have access. You can retrieve Subuser IDs from the [Subusers API](https://docs.sendgrid.com/api-reference/subusers-api/). | +**PermissionType** | [**PermissionType**](PermissionType.md) | Grant the level of access the Teammate should have to the specified Subuser with this property. This property value may be either `admin` or `restricted`. When set to `restricted`, the Teammate has only the permissions assigned in the `scopes` property. | +**Scopes** | **[]string** | Add or remove permissions that the Teammate can access on behalf of the Subuser. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. You should not include this property in the request when the `permission_type` property is set to `admin`—administrators have full access to the specified Subuser. |[optional] + +[[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/rest/api/v3/sso/docs/SsoTeammatesBaseResponseProps.md b/rest/api/v3/sso/docs/SsoTeammatesBaseResponseProps.md new file mode 100644 index 00000000..a2de9c35 --- /dev/null +++ b/rest/api/v3/sso/docs/SsoTeammatesBaseResponseProps.md @@ -0,0 +1,16 @@ +# SsoTeammatesBaseResponseProps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FirstName** | **string** | The Teammate's first name. |[optional] +**LastName** | **string** | The Teammate's last name. |[optional] +**Email** | **string** | Teammate's email address. This email address also functions as the Teammate's username and must match the address assigned to the user in your IdP. This address cannot be changed after the Teammate is created. |[optional] +**IsAdmin** | **bool** | Indicates if the Teammate has administrator permissions. When set to `true`, the Teammate is an admin. |[optional] +**IsSso** | **bool** | Indicates how the Teammate authenticates with SendGrid. When set to `true`, the Teammate will access SendGrid via SSO and their IdP. When set to `false`, the Teammate will authenticate directly with SendGrid via a username and password. |[optional] +**Scopes** | **[]string** | The permissions or scopes currently assigned to the Teammate. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. |[optional] + +[[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/rest/api/v3/sso/docs/SsoTeammatesRestrictedSubuserResponseProps.md b/rest/api/v3/sso/docs/SsoTeammatesRestrictedSubuserResponseProps.md new file mode 100644 index 00000000..a22ffc8f --- /dev/null +++ b/rest/api/v3/sso/docs/SsoTeammatesRestrictedSubuserResponseProps.md @@ -0,0 +1,12 @@ +# SsoTeammatesRestrictedSubuserResponseProps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**HasRestrictedSubuserAccess** | **bool** | When this property is set to `true`, the Teammate has permissions to operate only on behalf of a Subuser. This property value is `true` when the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. |[optional] +**SubuserAccess** | [**[]SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner**](SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner.md) | Specifies which Subusers the Teammate may access and act on behalf of. If this property is populated, the `has_restricted_subuser_access` property will be `true`. |[optional] + +[[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/rest/api/v3/sso/docs/SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner.md b/rest/api/v3/sso/docs/SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner.md new file mode 100644 index 00000000..c7c93940 --- /dev/null +++ b/rest/api/v3/sso/docs/SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner.md @@ -0,0 +1,16 @@ +# SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | The ID of a Subuser to which the Teammate has access. You can retrieve Subuser IDs from the [Subusers API](https://docs.sendgrid.com/api-reference/subusers-api/). |[optional] +**Username** | **string** | The username of a Subuser to which the Teammate has access. |[optional] +**Email** | **string** | The email address of a Subuser to which the Teammate has access. |[optional] +**Disabled** | **bool** | Indicates if the Subuser is active for the SendGrid account. |[optional] +**PermissionType** | [**PermissionType1**](PermissionType1.md) | The level of access the Teammate has to the specified Subuser. This property value may be either `admin` or `restricted`. When is property is set to `restricted`, the Teammate has only the permissions assigned in the `scopes` property. |[optional] +**Scopes** | **[]string** | The permissions or scopes that the Teammate can access on behalf of the Subuser. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. |[optional] + +[[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/rest/api/v3/sso/docs/UpdateSsoCertificate.md b/rest/api/v3/sso/docs/UpdateSsoCertificate.md new file mode 100644 index 00000000..0873a139 --- /dev/null +++ b/rest/api/v3/sso/docs/UpdateSsoCertificate.md @@ -0,0 +1,52 @@ +# UpdateSsoCertificate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateSsoCertificate**](UpdateSsoCertificate.md#UpdateSsoCertificate) | **Patch** /v3/sso/certificates/{CertId} | Update SSO Certificate + + + +## UpdateSsoCertificate + +> SsoCertificateBody UpdateSsoCertificate(ctx, CertIdoptional) + +Update SSO Certificate + +**This endpoint allows you to update an existing certificate by ID.** You can retrieve a certificate's ID from the response provided by the \"Get All SSO Integrations\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**CertId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateSsoCertificateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**UpdateSsoCertificateRequest** | [**UpdateSsoCertificateRequest**](UpdateSsoCertificateRequest.md) | + +### Return type + +[**SsoCertificateBody**](SsoCertificateBody.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/sso/docs/UpdateSsoCertificateRequest.md b/rest/api/v3/sso/docs/UpdateSsoCertificateRequest.md new file mode 100644 index 00000000..6155b47c --- /dev/null +++ b/rest/api/v3/sso/docs/UpdateSsoCertificateRequest.md @@ -0,0 +1,13 @@ +# UpdateSsoCertificateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PublicCertificate** | **string** | This public certificate allows SendGrid to verify that SAML requests it receives are signed by an IdP that it recognizes. |[optional] +**Enabled** | **bool** | Indicates whether or not the certificate is enabled. |[optional] +**IntegrationId** | **string** | An ID that matches a certificate to a specific IdP integration. |[optional] + +[[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/rest/api/v3/sso/docs/UpdateSsoIntegration.md b/rest/api/v3/sso/docs/UpdateSsoIntegration.md new file mode 100644 index 00000000..c6e31fe7 --- /dev/null +++ b/rest/api/v3/sso/docs/UpdateSsoIntegration.md @@ -0,0 +1,53 @@ +# UpdateSsoIntegration + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateSsoIntegration**](UpdateSsoIntegration.md#UpdateSsoIntegration) | **Patch** /v3/sso/integrations/{Id} | Update an SSO Integration + + + +## UpdateSsoIntegration + +> SsoIntegration UpdateSsoIntegration(ctx, Idoptional) + +Update an SSO Integration + +**This endpoint allows you to modify an exisiting SSO integration.** You can retrieve the IDs for your configurations from the response provided by the \"Get All SSO Integrations\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateSsoIntegrationParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Si** | **bool** | If this parameter is set to `true`, the response will include the `completed_integration` field. +**PostPatchIntegrationRequest** | [**PostPatchIntegrationRequest**](PostPatchIntegrationRequest.md) | + +### Return type + +[**SsoIntegration**](SsoIntegration.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/sso/docs/UpdateSsoTeammate.md b/rest/api/v3/sso/docs/UpdateSsoTeammate.md new file mode 100644 index 00000000..cc802214 --- /dev/null +++ b/rest/api/v3/sso/docs/UpdateSsoTeammate.md @@ -0,0 +1,52 @@ +# UpdateSsoTeammate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateSsoTeammate**](UpdateSsoTeammate.md#UpdateSsoTeammate) | **Patch** /v3/sso/teammates/{Username} | Edit an SSO Teammate + + + +## UpdateSsoTeammate + +> PatchSsoTeammates200 UpdateSsoTeammate(ctx, Usernameoptional) + +Edit an SSO Teammate + +**This endpoint allows you to modify an existing SSO Teammate.** Only the parent user and Teammates with admin permissions can update another Teammate's permissions. ### Scopes When updating a Teammate, you will assign it permissions or scopes. These scopes determine which actions the Teammate can perform and which features they can access. Scopes are provided with one of three properties passed to this endpoint: `is_admin`, `scopes`, and `persona`. You can make a Teammate an administrator by setting `is_admin` to `true`. Administrators will have all scopes assigned to them. Alternatively, you can assign a `persona` to the teammate, which will assign them a block of permissions commonly required for that type of user. See the \"Persona scopes\" section of [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions#persona-scopes) for a list of permsissions granted by persona. Lastly, you can assign individual permissions with the `scopes` property. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a full list of scopes that can be assigned to a Teammate. ### Subuser access SendGrid Teammates may be assigned access to one or more Subusers. Subusers function like SendGrid sub-accounts with their own resources. See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. When assigning Subuser access to a Teammate, you may set the `has_restricted_subuser_access` property to `true` to constrain the Teammate so that they can operate only on behalf of the Subusers to which they are assigned. You may further set the level of access the Teammate has to each Subuser with the `subuser_access` property. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Username** | **string** | Set this parameter to the Teammate's email address. This address must be the same address assigned to the Teammate in your IdP. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateSsoTeammateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Body** | **SsoTeammatesBaseRequestProps** | + +### Return type + +[**PatchSsoTeammates200**](PatchSsoTeammates200.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/sso/docs/UserType.md b/rest/api/v3/sso/docs/UserType.md new file mode 100644 index 00000000..f9f8db1d --- /dev/null +++ b/rest/api/v3/sso/docs/UserType.md @@ -0,0 +1,14 @@ +# UserType + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**ADMIN** | string | (value: `"admin"`) +**OWNER** | string | (value: `"owner"`) +**TEAMMATE** | string | (value: `"teammate"`) + + +[[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/rest/api/v3/sso/model_create_sso_certificate_request.go b/rest/api/v3/sso/model_create_sso_certificate_request.go new file mode 100644 index 00000000..da1fc7ba --- /dev/null +++ b/rest/api/v3/sso/model_create_sso_certificate_request.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateSsoCertificateRequest +type CreateSsoCertificateRequest struct { + // This public certificate allows SendGrid to verify that SAML requests it receives are signed by an IdP that it recognizes. + PublicCertificate string `json:"public_certificate"` + // Indicates if the certificate is enabled. + Enabled *bool `json:"enabled,omitempty"` + // An ID that matches a certificate to a specific IdP integration. This is the `id` returned by the \"Get All SSO Integrations\" endpoint. + IntegrationId string `json:"integration_id"` +} diff --git a/rest/api/v3/sso/model_patch_sso_teammates200.go b/rest/api/v3/sso/model_patch_sso_teammates200.go new file mode 100644 index 00000000..0031305b --- /dev/null +++ b/rest/api/v3/sso/model_patch_sso_teammates200.go @@ -0,0 +1,56 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// PatchSsoTeammates200 Successful SSO Teammates PATCH response. +type PatchSsoTeammates200 struct { + // The Teammate's street address. + Address *string `json:"address,omitempty"` + // The Teammate's apartment number, suite number, or other secondary address information that is not part of the physical street address. + Address2 *string `json:"address2,omitempty"` + // The Teammate's city. + City *string `json:"city,omitempty"` + // The Teammate's company name. + Company *string `json:"company,omitempty"` + // The Teammate's country of residence. + Country *string `json:"country,omitempty"` + // The Teammate's username. This property is set to the Teammate's email address. + Username *string `json:"username,omitempty"` + // The Teammate's phone number. + Phone *string `json:"phone,omitempty"` + // The Teammate's state or province. + State *string `json:"state,omitempty"` + // A Teammate can be an `admin`, `owner`, or `teammate`. Each role is associated with the scope of the Teammate's permissions. + UserType *UserType `json:"user_type,omitempty"` + // A website associated with the Teammate. + Website *string `json:"website,omitempty"` + // The Teammate's zip code. + Zip *string `json:"zip,omitempty"` + // The Teammate's first name. + FirstName *string `json:"first_name,omitempty"` + // The Teammate's last name. + LastName *string `json:"last_name,omitempty"` + // Teammate's email address. This email address also functions as the Teammate's username and must match the address assigned to the user in your IdP. This address cannot be changed after the Teammate is created. + Email *string `json:"email,omitempty"` + // Indicates if the Teammate has administrator permissions. When set to `true`, the Teammate is an admin. + IsAdmin *bool `json:"is_admin,omitempty"` + // Indicates how the Teammate authenticates with SendGrid. When set to `true`, the Teammate will access SendGrid via SSO and their IdP. When set to `false`, the Teammate will authenticate directly with SendGrid via a username and password. + IsSso *bool `json:"is_sso,omitempty"` + // The permissions or scopes currently assigned to the Teammate. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. + Scopes *[]string `json:"scopes,omitempty"` + // When this property is set to `true`, the Teammate has permissions to operate only on behalf of a Subuser. This property value is `true` when the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. + HasRestrictedSubuserAccess *bool `json:"has_restricted_subuser_access,omitempty"` + // Specifies which Subusers the Teammate may access and act on behalf of. If this property is populated, the `has_restricted_subuser_access` property will be `true`. + SubuserAccess *[]SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner `json:"subuser_access,omitempty"` +} diff --git a/rest/api/v3/sso/model_permission_type.go b/rest/api/v3/sso/model_permission_type.go new file mode 100644 index 00000000..c496f95f --- /dev/null +++ b/rest/api/v3/sso/model_permission_type.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// PermissionType the model 'PermissionType' +type PermissionType string + +// List of PermissionType +const ( + PERMISSIONTYPE_ADMIN PermissionType = "admin" + PERMISSIONTYPE_RESTRICTED PermissionType = "restricted" +) diff --git a/rest/api/v3/sso/model_permission_type1.go b/rest/api/v3/sso/model_permission_type1.go new file mode 100644 index 00000000..03271a27 --- /dev/null +++ b/rest/api/v3/sso/model_permission_type1.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// PermissionType1 the model 'PermissionType1' +type PermissionType1 string + +// List of PermissionType1 +const ( + PERMISSIONTYPE1_ADMIN PermissionType1 = "admin" + PERMISSIONTYPE1_RESTRICTED PermissionType1 = "restricted" +) diff --git a/rest/api/v3/sso/model_persona.go b/rest/api/v3/sso/model_persona.go new file mode 100644 index 00000000..bbd9d832 --- /dev/null +++ b/rest/api/v3/sso/model_persona.go @@ -0,0 +1,25 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Persona the model 'Persona' +type Persona string + +// List of Persona +const ( + PERSONA_ACCOUNTANT Persona = "accountant" + PERSONA_DEVELOPER Persona = "developer" + PERSONA_MARKETER Persona = "marketer" + PERSONA_OBSERVER Persona = "observer" +) diff --git a/rest/api/v3/sso/model_post_patch_integration_request.go b/rest/api/v3/sso/model_post_patch_integration_request.go new file mode 100644 index 00000000..6cdedd95 --- /dev/null +++ b/rest/api/v3/sso/model_post_patch_integration_request.go @@ -0,0 +1,30 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// PostPatchIntegrationRequest struct for PostPatchIntegrationRequest +type PostPatchIntegrationRequest struct { + // The name of your integration. This name can be anything that makes sense for your organization (eg. Twilio SendGrid) + Name string `json:"name"` + // Indicates if the integration is enabled. + Enabled bool `json:"enabled"` + // The IdP's SAML POST endpoint. This endpoint should receive requests and initiate an SSO login flow. This is called the \"Embed Link\" in the Twilio SendGrid UI. + SigninUrl string `json:"signin_url"` + // This URL is relevant only for an IdP-initiated authentication flow. If a user authenticates from their IdP, this URL will return them to their IdP when logging out. + SignoutUrl string `json:"signout_url"` + // An identifier provided by your IdP to identify Twilio SendGrid in the SAML interaction. This is called the \"SAML Issuer ID\" in the Twilio SendGrid UI. + EntityId string `json:"entity_id"` + // Indicates if the integration is complete. + CompletedIntegration *bool `json:"completed_integration,omitempty"` +} diff --git a/rest/api/v3/sso/model_post_sso_teammates201.go b/rest/api/v3/sso/model_post_sso_teammates201.go new file mode 100644 index 00000000..5863ff95 --- /dev/null +++ b/rest/api/v3/sso/model_post_sso_teammates201.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// PostSsoTeammates201 Successful SSO Teammates POST Response. +type PostSsoTeammates201 struct { + // The Teammate's first name. + FirstName *string `json:"first_name,omitempty"` + // The Teammate's last name. + LastName *string `json:"last_name,omitempty"` + // Teammate's email address. This email address also functions as the Teammate's username and must match the address assigned to the user in your IdP. This address cannot be changed after the Teammate is created. + Email *string `json:"email,omitempty"` + // Indicates if the Teammate has administrator permissions. When set to `true`, the Teammate is an admin. + IsAdmin *bool `json:"is_admin,omitempty"` + // Indicates how the Teammate authenticates with SendGrid. When set to `true`, the Teammate will access SendGrid via SSO and their IdP. When set to `false`, the Teammate will authenticate directly with SendGrid via a username and password. + IsSso *bool `json:"is_sso,omitempty"` + // The permissions or scopes currently assigned to the Teammate. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. + Scopes *[]string `json:"scopes,omitempty"` + // When this property is set to `true`, the Teammate has permissions to operate only on behalf of a Subuser. This property value is `true` when the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. + HasRestrictedSubuserAccess *bool `json:"has_restricted_subuser_access,omitempty"` + // Specifies which Subusers the Teammate may access and act on behalf of. If this property is populated, the `has_restricted_subuser_access` property will be `true`. + SubuserAccess *[]SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner `json:"subuser_access,omitempty"` +} diff --git a/rest/api/v3/sso/model_post_sso_teammates_request.go b/rest/api/v3/sso/model_post_sso_teammates_request.go new file mode 100644 index 00000000..5f4e5543 --- /dev/null +++ b/rest/api/v3/sso/model_post_sso_teammates_request.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// PostSsoTeammatesRequest struct for PostSsoTeammatesRequest +type PostSsoTeammatesRequest struct { + // Set this property to the Teammate's email address. This email address will also function as the Teammate's username and must match the address assigned to the user in your IdP. This address cannot be changed after the Teammate is created. + Email string `json:"email"` + // Set this property to the Teammate's first name. + FirstName string `json:"first_name"` + // Set this property to the Teammate's last name. + LastName string `json:"last_name"` + // Set this property to `true` if the Teammate has admin permissions. You should not include the `scopes` or `persona` properties when setting the `is_admin` property to `true`—an admin will be allocated all scopes. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of scopes. + IsAdmin *bool `json:"is_admin,omitempty"` + // A persona represents a group of permissions often required by a type of Teammate such as a developer or marketer. Assigning a persona allows you to allocate a group of pre-defined permissions rather than assigning each scope individually. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a full list of the scopes assigned to each persona. + Persona *Persona `json:"persona,omitempty"` + // Add or remove permissions from a Teammate using this `scopes` property. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. You should not include this propety in the request when using the `persona` property or when setting the `is_admin` property to `true`—assigning a `persona` or setting `is_admin` to `true` will allocate a group of permissions to the Teammate. + Scopes *[]string `json:"scopes,omitempty"` + // Set this property to `true` to give the Teammate permissions to operate only on behalf of a Subuser. This property value must be `true` if the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. If this property is set to `true`, you cannot specify individual `scopes`, assign a `persona`, or set `is_admin` to `true`—a Teammate cannot specify scopes for the parent account and have restricted Subuser access. + HasRestrictedSubuserAccess *bool `json:"has_restricted_subuser_access,omitempty"` + // Specify which Subusers the Teammate may access and act on behalf of with this property. If this property is populated, you must set the `has_restricted_subuser_access` property to `true`. + SubuserAccess *[]SsoTeammatesBaseRequestPropsSubuserAccessInner `json:"subuser_access,omitempty"` +} diff --git a/rest/api/v3/sso/model_sso_certificate_body.go b/rest/api/v3/sso/model_sso_certificate_body.go new file mode 100644 index 00000000..1a001b81 --- /dev/null +++ b/rest/api/v3/sso/model_sso_certificate_body.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SsoCertificateBody struct for SsoCertificateBody +type SsoCertificateBody struct { + // This certificate is used by Twilio SendGrid to verify that SAML requests are coming from Okta. This is called the X509 certificate in the Twilio SendGrid UI. + PublicCertificate *string `json:"public_certificate,omitempty"` + // A unique ID assigned to the certificate by SendGrid. + Id *float32 `json:"id,omitempty"` + // A unix timestamp (e.g., 1603915954) that indicates the time before which the certificate is not valid. + NotBefore *float32 `json:"not_before,omitempty"` + // A unix timestamp (e.g., 1603915954) that indicates the time after which the certificate is no longer valid. + NotAfter *float32 `json:"not_after,omitempty"` + // An ID that matches a certificate to a specific IdP integration. + IntergrationId *string `json:"intergration_id,omitempty"` +} diff --git a/rest/api/v3/sso/model_sso_error_response_inner.go b/rest/api/v3/sso/model_sso_error_response_inner.go new file mode 100644 index 00000000..17711b3d --- /dev/null +++ b/rest/api/v3/sso/model_sso_error_response_inner.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SsoErrorResponseInner struct for SsoErrorResponseInner +type SsoErrorResponseInner struct { + Message *string `json:"message,omitempty"` + Field *string `json:"field,omitempty"` + ErrorId *string `json:"error_id,omitempty"` +} diff --git a/rest/api/v3/sso/model_sso_integration.go b/rest/api/v3/sso/model_sso_integration.go new file mode 100644 index 00000000..888e08da --- /dev/null +++ b/rest/api/v3/sso/model_sso_integration.go @@ -0,0 +1,38 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SsoIntegration struct for SsoIntegration +type SsoIntegration struct { + // The name of your integration. This name can be anything that makes sense for your organization (eg. Twilio SendGrid) + Name string `json:"name"` + // Indicates if the integration is enabled. + Enabled bool `json:"enabled"` + // The IdP's SAML POST endpoint. This endpoint should receive requests and initiate an SSO login flow. This is called the \"Embed Link\" in the Twilio SendGrid UI. + SigninUrl string `json:"signin_url"` + // This URL is relevant only for an IdP-initiated authentication flow. If a user authenticates from their IdP, this URL will return them to their IdP when logging out. + SignoutUrl string `json:"signout_url"` + // An identifier provided by your IdP to identify Twilio SendGrid in the SAML interaction. This is called the \"SAML Issuer ID\" in the Twilio SendGrid UI. + EntityId string `json:"entity_id"` + // Indicates if the integration is complete. + CompletedIntegration *bool `json:"completed_integration,omitempty"` + // A timestamp representing the last time the configuration was modified. + LastUpdated float32 `json:"last_updated"` + // A unique ID assigned to the configuration by SendGrid. + Id *string `json:"id,omitempty"` + // The URL where your IdP should POST its SAML response. This is the Twilio SendGrid URL that is responsible for receiving and parsing a SAML assertion. This is the same URL as the Audience URL when using SendGrid. + SingleSignonUrl *string `json:"single_signon_url,omitempty"` + // The URL where your IdP should POST its SAML response. This is the Twilio SendGrid URL that is responsible for receiving and parsing a SAML assertion. This is the same URL as the Single Sign-On URL when using SendGrid. + AudienceUrl *string `json:"audience_url,omitempty"` +} diff --git a/rest/api/v3/sso/model_sso_teammates_base_request_props.go b/rest/api/v3/sso/model_sso_teammates_base_request_props.go new file mode 100644 index 00000000..8fd3ef6d --- /dev/null +++ b/rest/api/v3/sso/model_sso_teammates_base_request_props.go @@ -0,0 +1,32 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SsoTeammatesBaseRequestProps struct for SsoTeammatesBaseRequestProps +type SsoTeammatesBaseRequestProps struct { + // Set this property to the Teammate's first name. + FirstName string `json:"first_name"` + // Set this property to the Teammate's last name. + LastName string `json:"last_name"` + // Set this property to `true` if the Teammate has admin permissions. You should not include the `scopes` or `persona` properties when setting the `is_admin` property to `true`—an admin will be allocated all scopes. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of scopes. + IsAdmin *bool `json:"is_admin,omitempty"` + // A persona represents a group of permissions often required by a type of Teammate such as a developer or marketer. Assigning a persona allows you to allocate a group of pre-defined permissions rather than assigning each scope individually. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a full list of the scopes assigned to each persona. + Persona *Persona `json:"persona,omitempty"` + // Add or remove permissions from a Teammate using this `scopes` property. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. You should not include this propety in the request when using the `persona` property or when setting the `is_admin` property to `true`—assigning a `persona` or setting `is_admin` to `true` will allocate a group of permissions to the Teammate. + Scopes *[]string `json:"scopes,omitempty"` + // Set this property to `true` to give the Teammate permissions to operate only on behalf of a Subuser. This property value must be `true` if the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. If this property is set to `true`, you cannot specify individual `scopes`, assign a `persona`, or set `is_admin` to `true`—a Teammate cannot specify scopes for the parent account and have restricted Subuser access. + HasRestrictedSubuserAccess *bool `json:"has_restricted_subuser_access,omitempty"` + // Specify which Subusers the Teammate may access and act on behalf of with this property. If this property is populated, you must set the `has_restricted_subuser_access` property to `true`. + SubuserAccess *[]SsoTeammatesBaseRequestPropsSubuserAccessInner `json:"subuser_access,omitempty"` +} diff --git a/rest/api/v3/sso/model_sso_teammates_base_request_props_subuser_access_inner.go b/rest/api/v3/sso/model_sso_teammates_base_request_props_subuser_access_inner.go new file mode 100644 index 00000000..6a9499bd --- /dev/null +++ b/rest/api/v3/sso/model_sso_teammates_base_request_props_subuser_access_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SsoTeammatesBaseRequestPropsSubuserAccessInner An array of Subusers to which the Teammate should have access. +type SsoTeammatesBaseRequestPropsSubuserAccessInner struct { + // Set this property to the ID of a Subuser to which the Teammate should have access. You can retrieve Subuser IDs from the [Subusers API](https://docs.sendgrid.com/api-reference/subusers-api/). + Id int32 `json:"id"` + // Grant the level of access the Teammate should have to the specified Subuser with this property. This property value may be either `admin` or `restricted`. When set to `restricted`, the Teammate has only the permissions assigned in the `scopes` property. + PermissionType PermissionType `json:"permission_type"` + // Add or remove permissions that the Teammate can access on behalf of the Subuser. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. You should not include this property in the request when the `permission_type` property is set to `admin`—administrators have full access to the specified Subuser. + Scopes *[]string `json:"scopes,omitempty"` +} diff --git a/rest/api/v3/sso/model_sso_teammates_base_response_props.go b/rest/api/v3/sso/model_sso_teammates_base_response_props.go new file mode 100644 index 00000000..ca10b302 --- /dev/null +++ b/rest/api/v3/sso/model_sso_teammates_base_response_props.go @@ -0,0 +1,30 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SsoTeammatesBaseResponseProps struct for SsoTeammatesBaseResponseProps +type SsoTeammatesBaseResponseProps struct { + // The Teammate's first name. + FirstName *string `json:"first_name,omitempty"` + // The Teammate's last name. + LastName *string `json:"last_name,omitempty"` + // Teammate's email address. This email address also functions as the Teammate's username and must match the address assigned to the user in your IdP. This address cannot be changed after the Teammate is created. + Email *string `json:"email,omitempty"` + // Indicates if the Teammate has administrator permissions. When set to `true`, the Teammate is an admin. + IsAdmin *bool `json:"is_admin,omitempty"` + // Indicates how the Teammate authenticates with SendGrid. When set to `true`, the Teammate will access SendGrid via SSO and their IdP. When set to `false`, the Teammate will authenticate directly with SendGrid via a username and password. + IsSso *bool `json:"is_sso,omitempty"` + // The permissions or scopes currently assigned to the Teammate. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. + Scopes *[]string `json:"scopes,omitempty"` +} diff --git a/rest/api/v3/sso/model_sso_teammates_restricted_subuser_response_props.go b/rest/api/v3/sso/model_sso_teammates_restricted_subuser_response_props.go new file mode 100644 index 00000000..4570072d --- /dev/null +++ b/rest/api/v3/sso/model_sso_teammates_restricted_subuser_response_props.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SsoTeammatesRestrictedSubuserResponseProps struct for SsoTeammatesRestrictedSubuserResponseProps +type SsoTeammatesRestrictedSubuserResponseProps struct { + // When this property is set to `true`, the Teammate has permissions to operate only on behalf of a Subuser. This property value is `true` when the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. + HasRestrictedSubuserAccess *bool `json:"has_restricted_subuser_access,omitempty"` + // Specifies which Subusers the Teammate may access and act on behalf of. If this property is populated, the `has_restricted_subuser_access` property will be `true`. + SubuserAccess *[]SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner `json:"subuser_access,omitempty"` +} diff --git a/rest/api/v3/sso/model_sso_teammates_restricted_subuser_response_props_subuser_access_inner.go b/rest/api/v3/sso/model_sso_teammates_restricted_subuser_response_props_subuser_access_inner.go new file mode 100644 index 00000000..9d151365 --- /dev/null +++ b/rest/api/v3/sso/model_sso_teammates_restricted_subuser_response_props_subuser_access_inner.go @@ -0,0 +1,30 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner An array of Subusers to which the Teammate has access. +type SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner struct { + // The ID of a Subuser to which the Teammate has access. You can retrieve Subuser IDs from the [Subusers API](https://docs.sendgrid.com/api-reference/subusers-api/). + Id *int32 `json:"id,omitempty"` + // The username of a Subuser to which the Teammate has access. + Username *string `json:"username,omitempty"` + // The email address of a Subuser to which the Teammate has access. + Email *string `json:"email,omitempty"` + // Indicates if the Subuser is active for the SendGrid account. + Disabled *bool `json:"disabled,omitempty"` + // The level of access the Teammate has to the specified Subuser. This property value may be either `admin` or `restricted`. When is property is set to `restricted`, the Teammate has only the permissions assigned in the `scopes` property. + PermissionType *PermissionType1 `json:"permission_type,omitempty"` + // The permissions or scopes that the Teammate can access on behalf of the Subuser. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. + Scopes *[]string `json:"scopes,omitempty"` +} diff --git a/rest/api/v3/sso/model_update_sso_certificate_request.go b/rest/api/v3/sso/model_update_sso_certificate_request.go new file mode 100644 index 00000000..fd83330d --- /dev/null +++ b/rest/api/v3/sso/model_update_sso_certificate_request.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateSsoCertificateRequest struct for UpdateSsoCertificateRequest +type UpdateSsoCertificateRequest struct { + // This public certificate allows SendGrid to verify that SAML requests it receives are signed by an IdP that it recognizes. + PublicCertificate *string `json:"public_certificate,omitempty"` + // Indicates whether or not the certificate is enabled. + Enabled *bool `json:"enabled,omitempty"` + // An ID that matches a certificate to a specific IdP integration. + IntegrationId *string `json:"integration_id,omitempty"` +} diff --git a/rest/api/v3/sso/model_user_type.go b/rest/api/v3/sso/model_user_type.go new file mode 100644 index 00000000..3042c84a --- /dev/null +++ b/rest/api/v3/sso/model_user_type.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UserType the model 'UserType' +type UserType string + +// List of UserType +const ( + USERTYPE_ADMIN UserType = "admin" + USERTYPE_OWNER UserType = "owner" + USERTYPE_TEAMMATE UserType = "teammate" +) diff --git a/rest/api/v3/stats/.openapi-generator b/rest/api/v3/stats/.openapi-generator new file mode 100644 index 00000000..4e237e34 --- /dev/null +++ b/rest/api/v3/stats/.openapi-generator @@ -0,0 +1,80 @@ +.openapi-generator +.openapi-generator-ignore +README.md +api_get_client_stat.go +api_list_browser_stat.go +api_list_category.go +api_list_category_stat.go +api_list_category_stat_sum.go +api_list_client_stat.go +api_list_device_stat.go +api_list_geo_stat.go +api_list_mailbox_provider_stat.go +api_list_stat.go +api_service.go +docs/AdvancedStatsClicks.md +docs/AdvancedStatsClicksOpens.md +docs/AdvancedStatsMailboxProvider.md +docs/AdvancedStatsOpens.md +docs/AggregatedBy.md +docs/AggregatedBy1.md +docs/AggregatedBy2.md +docs/AggregatedBy3.md +docs/CategoryStats.md +docs/CategoryStatsStatsInner.md +docs/CategoryStatsStatsInnerMetrics.md +docs/ClientType.md +docs/Country.md +docs/GetClientStat.md +docs/ListBrowserStat.md +docs/ListBrowserStat200ResponseInner.md +docs/ListBrowserStat200ResponseInnerStatsInner.md +docs/ListCategory.md +docs/ListCategory200ResponseInner.md +docs/ListCategory400Response.md +docs/ListCategory400ResponseErrorsInner.md +docs/ListCategoryStat.md +docs/ListCategoryStatSum.md +docs/ListClientStat.md +docs/ListClientStat200ResponseInner.md +docs/ListClientStat200ResponseInnerStatsInner.md +docs/ListDeviceStat.md +docs/ListGeoStat.md +docs/ListGeoStat200ResponseInner.md +docs/ListGeoStat200ResponseInnerStatsInner.md +docs/ListMailboxProviderStat.md +docs/ListMailboxProviderStat200ResponseInner.md +docs/ListMailboxProviderStat200ResponseInnerStatsInner.md +docs/ListStat.md +docs/ListStat200ResponseInner.md +docs/ListStat200ResponseInnerStatsInner.md +docs/SortByDirection.md +docs/StatsAdvancedGlobalStats.md +model_advanced_stats_clicks.go +model_advanced_stats_clicks_opens.go +model_advanced_stats_mailbox_provider.go +model_advanced_stats_opens.go +model_aggregated_by.go +model_aggregated_by1.go +model_aggregated_by2.go +model_aggregated_by3.go +model_category_stats.go +model_category_stats_stats_inner.go +model_category_stats_stats_inner_metrics.go +model_client_type.go +model_country.go +model_list_browser_stat_200_response_inner.go +model_list_browser_stat_200_response_inner_stats_inner.go +model_list_category_200_response_inner.go +model_list_category_400_response.go +model_list_category_400_response_errors_inner.go +model_list_client_stat_200_response_inner.go +model_list_client_stat_200_response_inner_stats_inner.go +model_list_geo_stat_200_response_inner.go +model_list_geo_stat_200_response_inner_stats_inner.go +model_list_mailbox_provider_stat_200_response_inner.go +model_list_mailbox_provider_stat_200_response_inner_stats_inner.go +model_list_stat_200_response_inner.go +model_list_stat_200_response_inner_stats_inner.go +model_sort_by_direction.go +model_stats_advanced_global_stats.go diff --git a/rest/api/v3/stats/.openapi-generator-ignore b/rest/api/v3/stats/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/rest/api/v3/stats/.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/rest/api/v3/stats/README.md b/rest/api/v3/stats/README.md new file mode 100644 index 00000000..dd7596bf --- /dev/null +++ b/rest/api/v3/stats/README.md @@ -0,0 +1,104 @@ +# Go API client for + +The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. + +Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. + +SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. + +Category statistics are available for the previous thirteen months only. + +See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. + +## 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:44.471509+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 +------------ | ------------- | ------------- | ------------- +*GetClientStat* | [**GetClientStat**](docs/GetClientStat.md#getclientstat) | **Get** /v3/clients/{ClientType}/stats | Retrieve stats by a specific client type. +*ListBrowserStat* | [**ListBrowserStat**](docs/ListBrowserStat.md#listbrowserstat) | **Get** /v3/browsers/stats | Retrieve email statistics by browser. +*ListCategory* | [**ListCategory**](docs/ListCategory.md#listcategory) | **Get** /v3/categories | Retrieve all categories +*ListCategoryStat* | [**ListCategoryStat**](docs/ListCategoryStat.md#listcategorystat) | **Get** /v3/categories/stats | Retrieve Email Statistics for Categories +*ListCategoryStatSum* | [**ListCategoryStatSum**](docs/ListCategoryStatSum.md#listcategorystatsum) | **Get** /v3/categories/stats/sums | Retrieve sums of email stats for each category. +*ListClientStat* | [**ListClientStat**](docs/ListClientStat.md#listclientstat) | **Get** /v3/clients/stats | Retrieve email statistics by client type. +*ListDeviceStat* | [**ListDeviceStat**](docs/ListDeviceStat.md#listdevicestat) | **Get** /v3/devices/stats | Retrieve email statistics by device type. +*ListGeoStat* | [**ListGeoStat**](docs/ListGeoStat.md#listgeostat) | **Get** /v3/geo/stats | Retrieve email statistics by country and state/province. +*ListMailboxProviderStat* | [**ListMailboxProviderStat**](docs/ListMailboxProviderStat.md#listmailboxproviderstat) | **Get** /v3/mailbox_providers/stats | Retrieve email statistics by mailbox provider. +*ListStat* | [**ListStat**](docs/ListStat.md#liststat) | **Get** /v3/stats | Retrieve global email statistics + + +## Documentation For Models + + - [AdvancedStatsClicks](AdvancedStatsClicks.md) + - [AdvancedStatsClicksOpens](AdvancedStatsClicksOpens.md) + - [AdvancedStatsMailboxProvider](AdvancedStatsMailboxProvider.md) + - [AdvancedStatsOpens](AdvancedStatsOpens.md) + - [AggregatedBy](AggregatedBy.md) + - [AggregatedBy1](AggregatedBy1.md) + - [AggregatedBy2](AggregatedBy2.md) + - [AggregatedBy3](AggregatedBy3.md) + - [CategoryStats](CategoryStats.md) + - [CategoryStatsStatsInner](CategoryStatsStatsInner.md) + - [CategoryStatsStatsInnerMetrics](CategoryStatsStatsInnerMetrics.md) + - [ClientType](ClientType.md) + - [Country](Country.md) + - [ListBrowserStat200ResponseInner](ListBrowserStat200ResponseInner.md) + - [ListBrowserStat200ResponseInnerStatsInner](ListBrowserStat200ResponseInnerStatsInner.md) + - [ListCategory200ResponseInner](ListCategory200ResponseInner.md) + - [ListCategory400Response](ListCategory400Response.md) + - [ListCategory400ResponseErrorsInner](ListCategory400ResponseErrorsInner.md) + - [ListClientStat200ResponseInner](ListClientStat200ResponseInner.md) + - [ListClientStat200ResponseInnerStatsInner](ListClientStat200ResponseInnerStatsInner.md) + - [ListGeoStat200ResponseInner](ListGeoStat200ResponseInner.md) + - [ListGeoStat200ResponseInnerStatsInner](ListGeoStat200ResponseInnerStatsInner.md) + - [ListMailboxProviderStat200ResponseInner](ListMailboxProviderStat200ResponseInner.md) + - [ListMailboxProviderStat200ResponseInnerStatsInner](ListMailboxProviderStat200ResponseInnerStatsInner.md) + - [ListStat200ResponseInner](ListStat200ResponseInner.md) + - [ListStat200ResponseInnerStatsInner](ListStat200ResponseInnerStatsInner.md) + - [SortByDirection](SortByDirection.md) + - [StatsAdvancedGlobalStats](StatsAdvancedGlobalStats.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) +``` + diff --git a/rest/api/v3/stats/api_get_client_stat.go b/rest/api/v3/stats/api_get_client_stat.go new file mode 100644 index 00000000..8289a1c3 --- /dev/null +++ b/rest/api/v3/stats/api_get_client_stat.go @@ -0,0 +1,98 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/url" + + "strings" +) + +type GetClientStatParam struct { + // The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. + StartDate *string `json:"start_date"` + // Specifies the type of client to retrieve stats for. Must be either \"phone\", \"tablet\", \"webmail\", or \"desktop\". + ClientType *ClientType `json:"client_type"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + EndDate *string `json:"end_date,omitempty"` + // How to group the statistics. Must be either \"day\", \"week\", or \"month\". + AggregatedBy *AggregatedBy2 `json:"aggregated_by,omitempty"` +} + +func (params *GetClientStatParam) SetStartDate(StartDate string) *GetClientStatParam { + params.StartDate = &StartDate + return params +} +func (params *GetClientStatParam) SetClientType(ClientType ClientType) *GetClientStatParam { + params.ClientType = &ClientType + return params +} +func (params *GetClientStatParam) SetOnbehalfof(Onbehalfof string) *GetClientStatParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *GetClientStatParam) SetEndDate(EndDate string) *GetClientStatParam { + params.EndDate = &EndDate + return params +} +func (params *GetClientStatParam) SetAggregatedBy(AggregatedBy AggregatedBy2) *GetClientStatParam { + params.AggregatedBy = &AggregatedBy + return params +} + +// **This endpoint allows you to retrieve your email statistics segmented by a specific client type.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. ### Available Client Types - phone - tablet - webmail - desktop Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). +func (c *ApiService) GetClientStat(params *GetClientStatParam) (interface{}, error) { + path := "/v3/clients/{ClientType}/stats" + if params != nil && params.ClientType != nil { + path = strings.Replace(path, "{"+"ClientType"+"}", fmt.Sprint(*params.ClientType), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListClientStat200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/stats/api_list_browser_stat.go b/rest/api/v3/stats/api_list_browser_stat.go new file mode 100644 index 00000000..3e84d689 --- /dev/null +++ b/rest/api/v3/stats/api_list_browser_stat.go @@ -0,0 +1,114 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/url" +) + +type ListBrowserStatParam struct { + // The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. + StartDate *string `json:"start_date"` + // The browsers to get statistics for. You can include up to 10 different browsers by including this parameter multiple times. + Browsers *string `json:"browsers,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // The number of results to return. + Limit *int32 `json:"limit,omitempty"` + // The point in the list to begin retrieving results. + Offset *int32 `json:"offset,omitempty"` + // How to group the statistics. Must be either \"day\", \"week\", or \"month\". + AggregatedBy *AggregatedBy3 `json:"aggregated_by,omitempty"` + // The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + EndDate *string `json:"end_date,omitempty"` +} + +func (params *ListBrowserStatParam) SetStartDate(StartDate string) *ListBrowserStatParam { + params.StartDate = &StartDate + return params +} +func (params *ListBrowserStatParam) SetBrowsers(Browsers string) *ListBrowserStatParam { + params.Browsers = &Browsers + return params +} +func (params *ListBrowserStatParam) SetOnbehalfof(Onbehalfof string) *ListBrowserStatParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *ListBrowserStatParam) SetLimit(Limit int32) *ListBrowserStatParam { + params.Limit = &Limit + return params +} +func (params *ListBrowserStatParam) SetOffset(Offset int32) *ListBrowserStatParam { + params.Offset = &Offset + return params +} +func (params *ListBrowserStatParam) SetAggregatedBy(AggregatedBy AggregatedBy3) *ListBrowserStatParam { + params.AggregatedBy = &AggregatedBy + return params +} +func (params *ListBrowserStatParam) SetEndDate(EndDate string) *ListBrowserStatParam { + params.EndDate = &EndDate + return params +} + +// **This endpoint allows you to retrieve your email statistics segmented by browser type.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). +func (c *ApiService) ListBrowserStat(params *ListBrowserStatParam) (interface{}, error) { + path := "/v3/browsers/stats" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.Browsers != nil { + data.Set("browsers", *params.Browsers) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListBrowserStat200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/stats/api_list_category.go b/rest/api/v3/stats/api_list_category.go new file mode 100644 index 00000000..9805977a --- /dev/null +++ b/rest/api/v3/stats/api_list_category.go @@ -0,0 +1,95 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/url" +) + +type ListCategoryParam struct { + // `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. + Limit *int32 `json:"limit,omitempty"` + // Allows you to perform a prefix search on this particular category. + Category *string `json:"category,omitempty"` + // The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. + Offset *int32 `json:"offset,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListCategoryParam) SetLimit(Limit int32) *ListCategoryParam { + params.Limit = &Limit + return params +} +func (params *ListCategoryParam) SetCategory(Category string) *ListCategoryParam { + params.Category = &Category + return params +} +func (params *ListCategoryParam) SetOffset(Offset int32) *ListCategoryParam { + params.Offset = &Offset + return params +} +func (params *ListCategoryParam) SetOnbehalfof(Onbehalfof string) *ListCategoryParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a paginated list of all of your categories.** You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items. +func (c *ApiService) ListCategory(params *ListCategoryParam) (interface{}, error) { + path := "/v3/categories" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Category != nil { + data.Set("category", *params.Category) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListCategory200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ListCategory400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/stats/api_list_category_stat.go b/rest/api/v3/stats/api_list_category_stat.go new file mode 100644 index 00000000..442d45f9 --- /dev/null +++ b/rest/api/v3/stats/api_list_category_stat.go @@ -0,0 +1,96 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/url" +) + +type ListCategoryStatParam struct { + // The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD + StartDate *string `json:"start_date"` + // The individual categories that you want to retrieve statistics for. You may include up to 10 different categories. + Categories *string `json:"categories"` + // The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + EndDate *string `json:"end_date,omitempty"` + // How to group the statistics. Must be either \"day\", \"week\", or \"month\". + AggregatedBy *AggregatedBy `json:"aggregated_by,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListCategoryStatParam) SetStartDate(StartDate string) *ListCategoryStatParam { + params.StartDate = &StartDate + return params +} +func (params *ListCategoryStatParam) SetCategories(Categories string) *ListCategoryStatParam { + params.Categories = &Categories + return params +} +func (params *ListCategoryStatParam) SetEndDate(EndDate string) *ListCategoryStatParam { + params.EndDate = &EndDate + return params +} +func (params *ListCategoryStatParam) SetAggregatedBy(AggregatedBy AggregatedBy) *ListCategoryStatParam { + params.AggregatedBy = &AggregatedBy + return params +} +func (params *ListCategoryStatParam) SetOnbehalfof(Onbehalfof string) *ListCategoryStatParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve all of your email statistics for each of your categories.** If you do not define any query parameters, this endpoint will return a sum for each category in groups of 10. +func (c *ApiService) ListCategoryStat(params *ListCategoryStatParam) (interface{}, error) { + path := "/v3/categories/stats" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.Categories != nil { + data.Set("categories", *params.Categories) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]CategoryStats{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/stats/api_list_category_stat_sum.go b/rest/api/v3/stats/api_list_category_stat_sum.go new file mode 100644 index 00000000..02c40c28 --- /dev/null +++ b/rest/api/v3/stats/api_list_category_stat_sum.go @@ -0,0 +1,123 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/url" +) + +type ListCategoryStatSumParam struct { + // The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. + StartDate *string `json:"start_date"` + // The metric that you want to sort by. Must be a single metric. + SortByMetric *string `json:"sort_by_metric,omitempty"` + // The direction you want to sort. + SortByDirection *SortByDirection `json:"sort_by_direction,omitempty"` + // The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + EndDate *string `json:"end_date,omitempty"` + // Limits the number of results returned. + Limit *int32 `json:"limit,omitempty"` + // The point in the list to begin retrieving results. + Offset *int32 `json:"offset,omitempty"` + // How to group the statistics. Must be either \"day\", \"week\", or \"month\". + AggregatedBy *AggregatedBy1 `json:"aggregated_by,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListCategoryStatSumParam) SetStartDate(StartDate string) *ListCategoryStatSumParam { + params.StartDate = &StartDate + return params +} +func (params *ListCategoryStatSumParam) SetSortByMetric(SortByMetric string) *ListCategoryStatSumParam { + params.SortByMetric = &SortByMetric + return params +} +func (params *ListCategoryStatSumParam) SetSortByDirection(SortByDirection SortByDirection) *ListCategoryStatSumParam { + params.SortByDirection = &SortByDirection + return params +} +func (params *ListCategoryStatSumParam) SetEndDate(EndDate string) *ListCategoryStatSumParam { + params.EndDate = &EndDate + return params +} +func (params *ListCategoryStatSumParam) SetLimit(Limit int32) *ListCategoryStatSumParam { + params.Limit = &Limit + return params +} +func (params *ListCategoryStatSumParam) SetOffset(Offset int32) *ListCategoryStatSumParam { + params.Offset = &Offset + return params +} +func (params *ListCategoryStatSumParam) SetAggregatedBy(AggregatedBy AggregatedBy1) *ListCategoryStatSumParam { + params.AggregatedBy = &AggregatedBy + return params +} +func (params *ListCategoryStatSumParam) SetOnbehalfof(Onbehalfof string) *ListCategoryStatSumParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve the total sum of each email statistic for every category over the given date range.** If you do not define any query parameters, this endpoint will return a sum for each category in groups of 10. +func (c *ApiService) ListCategoryStatSum(params *ListCategoryStatSumParam) (interface{}, error) { + path := "/v3/categories/stats/sums" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.SortByMetric != nil { + data.Set("sort_by_metric", *params.SortByMetric) + } + if params != nil && params.SortByDirection != nil { + data.Set("sort_by_direction", fmt.Sprint(*params.SortByDirection)) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &CategoryStats{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/stats/api_list_client_stat.go b/rest/api/v3/stats/api_list_client_stat.go new file mode 100644 index 00000000..f663bac0 --- /dev/null +++ b/rest/api/v3/stats/api_list_client_stat.go @@ -0,0 +1,87 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/url" +) + +type ListClientStatParam struct { + // The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. + StartDate *string `json:"start_date"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + EndDate *string `json:"end_date,omitempty"` + // How to group the statistics. Must be either \"day\", \"week\", or \"month\". + AggregatedBy *AggregatedBy2 `json:"aggregated_by,omitempty"` +} + +func (params *ListClientStatParam) SetStartDate(StartDate string) *ListClientStatParam { + params.StartDate = &StartDate + return params +} +func (params *ListClientStatParam) SetOnbehalfof(Onbehalfof string) *ListClientStatParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *ListClientStatParam) SetEndDate(EndDate string) *ListClientStatParam { + params.EndDate = &EndDate + return params +} +func (params *ListClientStatParam) SetAggregatedBy(AggregatedBy AggregatedBy2) *ListClientStatParam { + params.AggregatedBy = &AggregatedBy + return params +} + +// **This endpoint allows you to retrieve your email statistics segmented by client type.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). +func (c *ApiService) ListClientStat(params *ListClientStatParam) (interface{}, error) { + path := "/v3/clients/stats" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListClientStat200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/stats/api_list_device_stat.go b/rest/api/v3/stats/api_list_device_stat.go new file mode 100644 index 00000000..24bc46a2 --- /dev/null +++ b/rest/api/v3/stats/api_list_device_stat.go @@ -0,0 +1,105 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/url" +) + +type ListDeviceStatParam struct { + // The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. + StartDate *string `json:"start_date"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // The number of results to return. + Limit *int32 `json:"limit,omitempty"` + // The point in the list to begin retrieving results. + Offset *int32 `json:"offset,omitempty"` + // How to group the statistics. Must be either \"day\", \"week\", or \"month\". + AggregatedBy *AggregatedBy3 `json:"aggregated_by,omitempty"` + // The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + EndDate *string `json:"end_date,omitempty"` +} + +func (params *ListDeviceStatParam) SetStartDate(StartDate string) *ListDeviceStatParam { + params.StartDate = &StartDate + return params +} +func (params *ListDeviceStatParam) SetOnbehalfof(Onbehalfof string) *ListDeviceStatParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *ListDeviceStatParam) SetLimit(Limit int32) *ListDeviceStatParam { + params.Limit = &Limit + return params +} +func (params *ListDeviceStatParam) SetOffset(Offset int32) *ListDeviceStatParam { + params.Offset = &Offset + return params +} +func (params *ListDeviceStatParam) SetAggregatedBy(AggregatedBy AggregatedBy3) *ListDeviceStatParam { + params.AggregatedBy = &AggregatedBy + return params +} +func (params *ListDeviceStatParam) SetEndDate(EndDate string) *ListDeviceStatParam { + params.EndDate = &EndDate + return params +} + +// **This endpoint allows you to retrieve your email statistics segmented by the device type.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. ## Available Device Types | **Device** | **Description** | **Example** | |---|---|---| | Desktop | Email software on desktop computer. | I.E., Outlook, Sparrow, or Apple Mail. | | Webmail | A web-based email client. | I.E., Yahoo, Google, AOL, or Outlook.com. | | Phone | A smart phone. | iPhone, Android, Blackberry, etc. | Tablet | A tablet computer. | iPad, android based tablet, etc. | | Other | An unrecognized device. | Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). +func (c *ApiService) ListDeviceStat(params *ListDeviceStatParam) (interface{}, error) { + path := "/v3/devices/stats" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListClientStat200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/stats/api_list_geo_stat.go b/rest/api/v3/stats/api_list_geo_stat.go new file mode 100644 index 00000000..083560d2 --- /dev/null +++ b/rest/api/v3/stats/api_list_geo_stat.go @@ -0,0 +1,114 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/url" +) + +type ListGeoStatParam struct { + // The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. + StartDate *string `json:"start_date"` + // The country you would like to see statistics for. Currently only supported for US and CA. + Country *Country `json:"country,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // The number of results to return. + Limit *int32 `json:"limit,omitempty"` + // The point in the list to begin retrieving results. + Offset *int32 `json:"offset,omitempty"` + // How to group the statistics. Must be either \"day\", \"week\", or \"month\". + AggregatedBy *AggregatedBy3 `json:"aggregated_by,omitempty"` + // The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + EndDate *string `json:"end_date,omitempty"` +} + +func (params *ListGeoStatParam) SetStartDate(StartDate string) *ListGeoStatParam { + params.StartDate = &StartDate + return params +} +func (params *ListGeoStatParam) SetCountry(Country Country) *ListGeoStatParam { + params.Country = &Country + return params +} +func (params *ListGeoStatParam) SetOnbehalfof(Onbehalfof string) *ListGeoStatParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *ListGeoStatParam) SetLimit(Limit int32) *ListGeoStatParam { + params.Limit = &Limit + return params +} +func (params *ListGeoStatParam) SetOffset(Offset int32) *ListGeoStatParam { + params.Offset = &Offset + return params +} +func (params *ListGeoStatParam) SetAggregatedBy(AggregatedBy AggregatedBy3) *ListGeoStatParam { + params.AggregatedBy = &AggregatedBy + return params +} +func (params *ListGeoStatParam) SetEndDate(EndDate string) *ListGeoStatParam { + params.EndDate = &EndDate + return params +} + +// **This endpoint allows you to retrieve your email statistics segmented by country and state/province.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [User Guide](https://wwww.twilio.com/docs/sendgrid/ui/analytics-and-reporting/stats-overview). +func (c *ApiService) ListGeoStat(params *ListGeoStatParam) (interface{}, error) { + path := "/v3/geo/stats" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.Country != nil { + data.Set("country", fmt.Sprint(*params.Country)) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListGeoStat200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/stats/api_list_mailbox_provider_stat.go b/rest/api/v3/stats/api_list_mailbox_provider_stat.go new file mode 100644 index 00000000..98436deb --- /dev/null +++ b/rest/api/v3/stats/api_list_mailbox_provider_stat.go @@ -0,0 +1,114 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/url" +) + +type ListMailboxProviderStatParam struct { + // The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. + StartDate *string `json:"start_date"` + // The mail box providers to get statistics for. You can include up to 10 by including this parameter multiple times. + MailboxProviders *string `json:"mailbox_providers,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // The number of results to return. + Limit *int32 `json:"limit,omitempty"` + // The point in the list to begin retrieving results. + Offset *int32 `json:"offset,omitempty"` + // How to group the statistics. Must be either \"day\", \"week\", or \"month\". + AggregatedBy *AggregatedBy3 `json:"aggregated_by,omitempty"` + // The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + EndDate *string `json:"end_date,omitempty"` +} + +func (params *ListMailboxProviderStatParam) SetStartDate(StartDate string) *ListMailboxProviderStatParam { + params.StartDate = &StartDate + return params +} +func (params *ListMailboxProviderStatParam) SetMailboxProviders(MailboxProviders string) *ListMailboxProviderStatParam { + params.MailboxProviders = &MailboxProviders + return params +} +func (params *ListMailboxProviderStatParam) SetOnbehalfof(Onbehalfof string) *ListMailboxProviderStatParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *ListMailboxProviderStatParam) SetLimit(Limit int32) *ListMailboxProviderStatParam { + params.Limit = &Limit + return params +} +func (params *ListMailboxProviderStatParam) SetOffset(Offset int32) *ListMailboxProviderStatParam { + params.Offset = &Offset + return params +} +func (params *ListMailboxProviderStatParam) SetAggregatedBy(AggregatedBy AggregatedBy3) *ListMailboxProviderStatParam { + params.AggregatedBy = &AggregatedBy + return params +} +func (params *ListMailboxProviderStatParam) SetEndDate(EndDate string) *ListMailboxProviderStatParam { + params.EndDate = &EndDate + return params +} + +// **This endpoint allows you to retrieve your email statistics segmented by recipient mailbox provider.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). +func (c *ApiService) ListMailboxProviderStat(params *ListMailboxProviderStatParam) (interface{}, error) { + path := "/v3/mailbox_providers/stats" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.MailboxProviders != nil { + data.Set("mailbox_providers", *params.MailboxProviders) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListMailboxProviderStat200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/stats/api_list_stat.go b/rest/api/v3/stats/api_list_stat.go new file mode 100644 index 00000000..9b0f05e8 --- /dev/null +++ b/rest/api/v3/stats/api_list_stat.go @@ -0,0 +1,105 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/url" +) + +type ListStatParam struct { + // The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. + StartDate *string `json:"start_date"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // The number of results to return. + Limit *int32 `json:"limit,omitempty"` + // The point in the list to begin retrieving results. + Offset *int32 `json:"offset,omitempty"` + // How to group the statistics. Must be either \"day\", \"week\", or \"month\". + AggregatedBy *AggregatedBy3 `json:"aggregated_by,omitempty"` + // The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + EndDate *string `json:"end_date,omitempty"` +} + +func (params *ListStatParam) SetStartDate(StartDate string) *ListStatParam { + params.StartDate = &StartDate + return params +} +func (params *ListStatParam) SetOnbehalfof(Onbehalfof string) *ListStatParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *ListStatParam) SetLimit(Limit int32) *ListStatParam { + params.Limit = &Limit + return params +} +func (params *ListStatParam) SetOffset(Offset int32) *ListStatParam { + params.Offset = &Offset + return params +} +func (params *ListStatParam) SetAggregatedBy(AggregatedBy AggregatedBy3) *ListStatParam { + params.AggregatedBy = &AggregatedBy + return params +} +func (params *ListStatParam) SetEndDate(EndDate string) *ListStatParam { + params.EndDate = &EndDate + return params +} + +// **This endpoint allows you to retrieve all of your global email statistics between a given date range.** Parent accounts can see either aggregated stats for the parent account or aggregated stats for a subuser specified in the `on-behalf-of` header. Subuser accounts will see only their own stats. +func (c *ApiService) ListStat(params *ListStatParam) (interface{}, error) { + path := "/v3/stats" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListStat200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return nil, nil +} diff --git a/rest/api/v3/stats/api_service.go b/rest/api/v3/stats/api_service.go new file mode 100644 index 00000000..29d8f9f5 --- /dev/null +++ b/rest/api/v3/stats/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/stats/docs/AdvancedStatsClicks.md b/rest/api/v3/stats/docs/AdvancedStatsClicks.md new file mode 100644 index 00000000..3f2f87ae --- /dev/null +++ b/rest/api/v3/stats/docs/AdvancedStatsClicks.md @@ -0,0 +1,12 @@ +# AdvancedStatsClicks + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Clicks** | **int32** | The number of links that were clicked in your emails. |[optional] +**UniqueClicks** | **int32** | The number of unique recipients who clicked links in your emails. |[optional] + +[[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/rest/api/v3/stats/docs/AdvancedStatsClicksOpens.md b/rest/api/v3/stats/docs/AdvancedStatsClicksOpens.md new file mode 100644 index 00000000..38d8c2e1 --- /dev/null +++ b/rest/api/v3/stats/docs/AdvancedStatsClicksOpens.md @@ -0,0 +1,14 @@ +# AdvancedStatsClicksOpens + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Clicks** | **int32** | The number of links that were clicked in your emails. |[optional] +**UniqueClicks** | **int32** | The number of unique recipients who clicked links in your emails. |[optional] +**Opens** | **int32** | The total number of times your emails were opened by recipients. |[optional] +**UniqueOpens** | **int32** | The number of unique recipients who opened your emails. |[optional] + +[[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/rest/api/v3/stats/docs/AdvancedStatsMailboxProvider.md b/rest/api/v3/stats/docs/AdvancedStatsMailboxProvider.md new file mode 100644 index 00000000..403c4943 --- /dev/null +++ b/rest/api/v3/stats/docs/AdvancedStatsMailboxProvider.md @@ -0,0 +1,18 @@ +# AdvancedStatsMailboxProvider + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Blocks** | **int32** | The number of emails that were not allowed to be delivered by ISPs. |[optional] +**Bounces** | **int32** | The number of emails that bounced instead of being delivered. |[optional] +**Deferred** | **int32** | The number of emails that temporarily could not be delivered. |[optional] +**Delivered** | **int32** | The number of emails SendGrid was able to confirm were actually delivered to a recipient. |[optional] +**Drops** | **int32** | The number of emails that were not delivered due to the recipient email address being on a suppression list. |[optional] +**Requests** | **int32** | The number of emails that were requested to be delivered. |[optional] +**Processed** | **int32** | Requests from your website, application, or mail client via SMTP Relay or the Web API that SendGrid processed. |[optional] +**SpamReports** | **int32** | The number of recipients who marked your email as spam. |[optional] + +[[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/rest/api/v3/stats/docs/AdvancedStatsOpens.md b/rest/api/v3/stats/docs/AdvancedStatsOpens.md new file mode 100644 index 00000000..ebab3e99 --- /dev/null +++ b/rest/api/v3/stats/docs/AdvancedStatsOpens.md @@ -0,0 +1,12 @@ +# AdvancedStatsOpens + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Opens** | **int32** | The total number of times your emails were opened by recipients. |[optional] +**UniqueOpens** | **int32** | The number of unique recipients who opened your emails. |[optional] + +[[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/rest/api/v3/stats/docs/AggregatedBy.md b/rest/api/v3/stats/docs/AggregatedBy.md new file mode 100644 index 00000000..96f02c9f --- /dev/null +++ b/rest/api/v3/stats/docs/AggregatedBy.md @@ -0,0 +1,14 @@ +# AggregatedBy + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DAY** | string | (value: `"day"`) +**WEEK** | string | (value: `"week"`) +**MONTH** | string | (value: `"month"`) + + +[[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/rest/api/v3/stats/docs/AggregatedBy1.md b/rest/api/v3/stats/docs/AggregatedBy1.md new file mode 100644 index 00000000..b34f829d --- /dev/null +++ b/rest/api/v3/stats/docs/AggregatedBy1.md @@ -0,0 +1,14 @@ +# AggregatedBy1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DAY** | string | (value: `"day"`) +**WEEK** | string | (value: `"week"`) +**MONTH** | string | (value: `"month"`) + + +[[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/rest/api/v3/stats/docs/AggregatedBy2.md b/rest/api/v3/stats/docs/AggregatedBy2.md new file mode 100644 index 00000000..9bf04eed --- /dev/null +++ b/rest/api/v3/stats/docs/AggregatedBy2.md @@ -0,0 +1,14 @@ +# AggregatedBy2 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DAY** | string | (value: `"day"`) +**WEEK** | string | (value: `"week"`) +**MONTH** | string | (value: `"month"`) + + +[[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/rest/api/v3/stats/docs/AggregatedBy3.md b/rest/api/v3/stats/docs/AggregatedBy3.md new file mode 100644 index 00000000..7504b230 --- /dev/null +++ b/rest/api/v3/stats/docs/AggregatedBy3.md @@ -0,0 +1,14 @@ +# AggregatedBy3 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DAY** | string | (value: `"day"`) +**WEEK** | string | (value: `"week"`) +**MONTH** | string | (value: `"month"`) + + +[[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/rest/api/v3/stats/docs/CategoryStats.md b/rest/api/v3/stats/docs/CategoryStats.md new file mode 100644 index 00000000..2b136fe2 --- /dev/null +++ b/rest/api/v3/stats/docs/CategoryStats.md @@ -0,0 +1,12 @@ +# CategoryStats + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Date** | **string** | The date the statistics were gathered. | +**Stats** | [**[]CategoryStatsStatsInner**](CategoryStatsStatsInner.md) | |[optional] + +[[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/rest/api/v3/stats/docs/CategoryStatsStatsInner.md b/rest/api/v3/stats/docs/CategoryStatsStatsInner.md new file mode 100644 index 00000000..9c188e0c --- /dev/null +++ b/rest/api/v3/stats/docs/CategoryStatsStatsInner.md @@ -0,0 +1,13 @@ +# CategoryStatsStatsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Metrics** | [**CategoryStatsStatsInnerMetrics**](CategoryStatsStatsInnerMetrics.md) | |[optional] +**Name** | **string** | The name of the category. |[optional] +**Type** | **string** | How you are segmenting your statistics. | + +[[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/rest/api/v3/stats/docs/CategoryStatsStatsInnerMetrics.md b/rest/api/v3/stats/docs/CategoryStatsStatsInnerMetrics.md new file mode 100644 index 00000000..8129c1f4 --- /dev/null +++ b/rest/api/v3/stats/docs/CategoryStatsStatsInnerMetrics.md @@ -0,0 +1,26 @@ +# CategoryStatsStatsInnerMetrics + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Blocks** | **int32** | The number of emails that were not allowed to be delivered by ISPs. | +**BounceDrops** | **int32** | The number of emails that were dropped because of a bounce. | +**Bounces** | **int32** | The number of emails that bounced instead of being delivered. | +**Clicks** | **int32** | The number of links that were clicked. | +**Deferred** | **int32** | The number of emails that temporarily could not be delivered. | +**Delivered** | **int32** | The number of emails SendGrid was able to confirm were actually delivered to a recipient. | +**InvalidEmails** | **int32** | The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid. | +**Opens** | **int32** | The total number of times your emails were opened by recipients. | +**Processed** | **int32** | Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed. | +**Requests** | **int32** | The number of emails that were requested to be delivered. | +**SpamReportDrops** | **int32** | The number of emails that were dropped due to a recipient previously marking your emails as spam. | +**SpamReports** | **int32** | The number of recipients who marked your email as spam. | +**UniqueClicks** | **int32** | The number of unique recipients who clicked links in your emails. | +**UniqueOpens** | **int32** | The number of unique recipients who opened your emails. | +**UnsubscribeDrops** | **int32** | The number of emails dropped due to a recipient unsubscribing from your emails. | +**Unsubscribes** | **int32** | The number of recipients who unsubscribed from your emails. | + +[[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/rest/api/v3/stats/docs/ClientType.md b/rest/api/v3/stats/docs/ClientType.md new file mode 100644 index 00000000..8a7f8487 --- /dev/null +++ b/rest/api/v3/stats/docs/ClientType.md @@ -0,0 +1,15 @@ +# ClientType + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**PHONE** | string | (value: `"phone"`) +**TABLET** | string | (value: `"tablet"`) +**WEBMAIL** | string | (value: `"webmail"`) +**DESKTOP** | string | (value: `"desktop"`) + + +[[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/rest/api/v3/stats/docs/Country.md b/rest/api/v3/stats/docs/Country.md new file mode 100644 index 00000000..00c5f179 --- /dev/null +++ b/rest/api/v3/stats/docs/Country.md @@ -0,0 +1,13 @@ +# Country + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**US** | string | (value: `"US"`) +**CA** | string | (value: `"CA"`) + + +[[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/rest/api/v3/stats/docs/GetClientStat.md b/rest/api/v3/stats/docs/GetClientStat.md new file mode 100644 index 00000000..bdd7639d --- /dev/null +++ b/rest/api/v3/stats/docs/GetClientStat.md @@ -0,0 +1,54 @@ +# GetClientStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetClientStat**](GetClientStat.md#GetClientStat) | **Get** /v3/clients/{ClientType}/stats | Retrieve stats by a specific client type. + + + +## GetClientStat + +> []ListClientStat200ResponseInner GetClientStat(ctx, StartDateClientTypeoptional) + +Retrieve stats by a specific client type. + +**This endpoint allows you to retrieve your email statistics segmented by a specific client type.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. ### Available Client Types - phone - tablet - webmail - desktop Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**ClientType** | [**ClientType**](ClientType.md) | Specifies the type of client to retrieve stats for. Must be either \"phone\", \"tablet\", \"webmail\", or \"desktop\". + +### Other Parameters + +Other parameters are passed through a pointer to a GetClientStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**EndDate** | **string** | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. +**AggregatedBy** | [**AggregatedBy2**](AggregatedBy2AggregatedBy2.md) | How to group the statistics. Must be either \"day\", \"week\", or \"month\". + +### Return type + +[**[]ListClientStat200ResponseInner**](ListClientStat200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/stats/docs/ListBrowserStat.md b/rest/api/v3/stats/docs/ListBrowserStat.md new file mode 100644 index 00000000..00b5d584 --- /dev/null +++ b/rest/api/v3/stats/docs/ListBrowserStat.md @@ -0,0 +1,53 @@ +# ListBrowserStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListBrowserStat**](ListBrowserStat.md#ListBrowserStat) | **Get** /v3/browsers/stats | Retrieve email statistics by browser. + + + +## ListBrowserStat + +> []ListBrowserStat200ResponseInner ListBrowserStat(ctx, StartDateoptional) + +Retrieve email statistics by browser. + +**This endpoint allows you to retrieve your email statistics segmented by browser type.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListBrowserStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Browsers** | **string** | The browsers to get statistics for. You can include up to 10 different browsers by including this parameter multiple times. +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**Limit** | **int32** | The number of results to return. +**Offset** | **int32** | The point in the list to begin retrieving results. +**AggregatedBy** | [**AggregatedBy3**](AggregatedBy3AggregatedBy3.md) | How to group the statistics. Must be either \"day\", \"week\", or \"month\". +**EndDate** | **string** | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + +### Return type + +[**[]ListBrowserStat200ResponseInner**](ListBrowserStat200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/stats/docs/ListBrowserStat200ResponseInner.md b/rest/api/v3/stats/docs/ListBrowserStat200ResponseInner.md new file mode 100644 index 00000000..b4f98ab1 --- /dev/null +++ b/rest/api/v3/stats/docs/ListBrowserStat200ResponseInner.md @@ -0,0 +1,12 @@ +# ListBrowserStat200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Date** | **string** | The date that the statistics were gathered. |[optional] +**Stats** | [**[]ListBrowserStat200ResponseInnerStatsInner**](ListBrowserStat200ResponseInnerStatsInner.md) | The list of statistics. |[optional] + +[[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/rest/api/v3/stats/docs/ListBrowserStat200ResponseInnerStatsInner.md b/rest/api/v3/stats/docs/ListBrowserStat200ResponseInnerStatsInner.md new file mode 100644 index 00000000..42ea5d07 --- /dev/null +++ b/rest/api/v3/stats/docs/ListBrowserStat200ResponseInnerStatsInner.md @@ -0,0 +1,13 @@ +# ListBrowserStat200ResponseInnerStatsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | The type of segmentation. |[optional] +**Name** | **string** | The name of the specific segmentation. |[optional] +**Metrics** | [**AdvancedStatsClicks**](AdvancedStatsClicks.md) | |[optional] + +[[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/rest/api/v3/stats/docs/ListCategory.md b/rest/api/v3/stats/docs/ListCategory.md new file mode 100644 index 00000000..02a75cbb --- /dev/null +++ b/rest/api/v3/stats/docs/ListCategory.md @@ -0,0 +1,51 @@ +# ListCategory + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListCategory**](ListCategory.md#ListCategory) | **Get** /v3/categories | Retrieve all categories + + + +## ListCategory + +> []ListCategory200ResponseInner ListCategory(ctx, optional) + +Retrieve all categories + +**This endpoint allows you to retrieve a paginated list of all of your categories.** You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListCategoryParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Limit** | **int32** | `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. +**Category** | **string** | Allows you to perform a prefix search on this particular category. +**Offset** | **int32** | The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**[]ListCategory200ResponseInner**](ListCategory200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/stats/docs/ListCategory200ResponseInner.md b/rest/api/v3/stats/docs/ListCategory200ResponseInner.md new file mode 100644 index 00000000..528bed33 --- /dev/null +++ b/rest/api/v3/stats/docs/ListCategory200ResponseInner.md @@ -0,0 +1,11 @@ +# ListCategory200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Category** | **string** | A category used to group emails by broad topic. | + +[[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/rest/api/v3/stats/docs/ListCategory400Response.md b/rest/api/v3/stats/docs/ListCategory400Response.md new file mode 100644 index 00000000..1163a96f --- /dev/null +++ b/rest/api/v3/stats/docs/ListCategory400Response.md @@ -0,0 +1,11 @@ +# ListCategory400Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ListCategory400ResponseErrorsInner**](ListCategory400ResponseErrorsInner.md) | The error returned. |[optional] + +[[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/rest/api/v3/stats/docs/ListCategory400ResponseErrorsInner.md b/rest/api/v3/stats/docs/ListCategory400ResponseErrorsInner.md new file mode 100644 index 00000000..413c97ee --- /dev/null +++ b/rest/api/v3/stats/docs/ListCategory400ResponseErrorsInner.md @@ -0,0 +1,12 @@ +# ListCategory400ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Field** | **string** | | +**Message** | **string** | A message explaining why your categories could not be retrieved. | + +[[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/rest/api/v3/stats/docs/ListCategoryStat.md b/rest/api/v3/stats/docs/ListCategoryStat.md new file mode 100644 index 00000000..715c2215 --- /dev/null +++ b/rest/api/v3/stats/docs/ListCategoryStat.md @@ -0,0 +1,50 @@ +# ListCategoryStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListCategoryStat**](ListCategoryStat.md#ListCategoryStat) | **Get** /v3/categories/stats | Retrieve Email Statistics for Categories + + + +## ListCategoryStat + +> []CategoryStats ListCategoryStat(ctx, StartDateCategoriesoptional) + +Retrieve Email Statistics for Categories + +**This endpoint allows you to retrieve all of your email statistics for each of your categories.** If you do not define any query parameters, this endpoint will return a sum for each category in groups of 10. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListCategoryStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**EndDate** | **string** | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. +**AggregatedBy** | [**AggregatedBy**](AggregatedByAggregatedBy.md) | How to group the statistics. Must be either \"day\", \"week\", or \"month\". +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**[]CategoryStats**](CategoryStats.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/stats/docs/ListCategoryStatSum.md b/rest/api/v3/stats/docs/ListCategoryStatSum.md new file mode 100644 index 00000000..18067fc6 --- /dev/null +++ b/rest/api/v3/stats/docs/ListCategoryStatSum.md @@ -0,0 +1,54 @@ +# ListCategoryStatSum + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListCategoryStatSum**](ListCategoryStatSum.md#ListCategoryStatSum) | **Get** /v3/categories/stats/sums | Retrieve sums of email stats for each category. + + + +## ListCategoryStatSum + +> CategoryStats ListCategoryStatSum(ctx, StartDateoptional) + +Retrieve sums of email stats for each category. + +**This endpoint allows you to retrieve the total sum of each email statistic for every category over the given date range.** If you do not define any query parameters, this endpoint will return a sum for each category in groups of 10. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListCategoryStatSumParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**SortByMetric** | **string** | The metric that you want to sort by. Must be a single metric. +**SortByDirection** | [**SortByDirection**](SortByDirectionSortByDirection.md) | The direction you want to sort. +**EndDate** | **string** | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. +**Limit** | **int32** | Limits the number of results returned. +**Offset** | **int32** | The point in the list to begin retrieving results. +**AggregatedBy** | [**AggregatedBy1**](AggregatedBy1AggregatedBy1.md) | How to group the statistics. Must be either \"day\", \"week\", or \"month\". +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**CategoryStats**](CategoryStats.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/stats/docs/ListClientStat.md b/rest/api/v3/stats/docs/ListClientStat.md new file mode 100644 index 00000000..12cd3294 --- /dev/null +++ b/rest/api/v3/stats/docs/ListClientStat.md @@ -0,0 +1,50 @@ +# ListClientStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListClientStat**](ListClientStat.md#ListClientStat) | **Get** /v3/clients/stats | Retrieve email statistics by client type. + + + +## ListClientStat + +> []ListClientStat200ResponseInner ListClientStat(ctx, StartDateoptional) + +Retrieve email statistics by client type. + +**This endpoint allows you to retrieve your email statistics segmented by client type.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListClientStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**EndDate** | **string** | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. +**AggregatedBy** | [**AggregatedBy2**](AggregatedBy2AggregatedBy2.md) | How to group the statistics. Must be either \"day\", \"week\", or \"month\". + +### Return type + +[**[]ListClientStat200ResponseInner**](ListClientStat200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/stats/docs/ListClientStat200ResponseInner.md b/rest/api/v3/stats/docs/ListClientStat200ResponseInner.md new file mode 100644 index 00000000..dfc7e624 --- /dev/null +++ b/rest/api/v3/stats/docs/ListClientStat200ResponseInner.md @@ -0,0 +1,12 @@ +# ListClientStat200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Date** | **string** | The date that the statistics were gathered. |[optional] +**Stats** | [**[]ListClientStat200ResponseInnerStatsInner**](ListClientStat200ResponseInnerStatsInner.md) | The list of statistics. |[optional] + +[[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/rest/api/v3/stats/docs/ListClientStat200ResponseInnerStatsInner.md b/rest/api/v3/stats/docs/ListClientStat200ResponseInnerStatsInner.md new file mode 100644 index 00000000..c065ab77 --- /dev/null +++ b/rest/api/v3/stats/docs/ListClientStat200ResponseInnerStatsInner.md @@ -0,0 +1,13 @@ +# ListClientStat200ResponseInnerStatsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | The type of segmentation. |[optional] +**Name** | **string** | The name of the specific segmentation. |[optional] +**Metrics** | [**AdvancedStatsOpens**](AdvancedStatsOpens.md) | |[optional] + +[[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/rest/api/v3/stats/docs/ListDeviceStat.md b/rest/api/v3/stats/docs/ListDeviceStat.md new file mode 100644 index 00000000..e3f910f4 --- /dev/null +++ b/rest/api/v3/stats/docs/ListDeviceStat.md @@ -0,0 +1,52 @@ +# ListDeviceStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListDeviceStat**](ListDeviceStat.md#ListDeviceStat) | **Get** /v3/devices/stats | Retrieve email statistics by device type. + + + +## ListDeviceStat + +> []ListClientStat200ResponseInner ListDeviceStat(ctx, StartDateoptional) + +Retrieve email statistics by device type. + +**This endpoint allows you to retrieve your email statistics segmented by the device type.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. ## Available Device Types | **Device** | **Description** | **Example** | |---|---|---| | Desktop | Email software on desktop computer. | I.E., Outlook, Sparrow, or Apple Mail. | | Webmail | A web-based email client. | I.E., Yahoo, Google, AOL, or Outlook.com. | | Phone | A smart phone. | iPhone, Android, Blackberry, etc. | Tablet | A tablet computer. | iPad, android based tablet, etc. | | Other | An unrecognized device. | Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListDeviceStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**Limit** | **int32** | The number of results to return. +**Offset** | **int32** | The point in the list to begin retrieving results. +**AggregatedBy** | [**AggregatedBy3**](AggregatedBy3AggregatedBy3.md) | How to group the statistics. Must be either \"day\", \"week\", or \"month\". +**EndDate** | **string** | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + +### Return type + +[**[]ListClientStat200ResponseInner**](ListClientStat200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/stats/docs/ListGeoStat.md b/rest/api/v3/stats/docs/ListGeoStat.md new file mode 100644 index 00000000..3c66f64e --- /dev/null +++ b/rest/api/v3/stats/docs/ListGeoStat.md @@ -0,0 +1,53 @@ +# ListGeoStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListGeoStat**](ListGeoStat.md#ListGeoStat) | **Get** /v3/geo/stats | Retrieve email statistics by country and state/province. + + + +## ListGeoStat + +> []ListGeoStat200ResponseInner ListGeoStat(ctx, StartDateoptional) + +Retrieve email statistics by country and state/province. + +**This endpoint allows you to retrieve your email statistics segmented by country and state/province.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [User Guide](https://wwww.twilio.com/docs/sendgrid/ui/analytics-and-reporting/stats-overview). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListGeoStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Country** | [**Country**](CountryCountry.md) | The country you would like to see statistics for. Currently only supported for US and CA. +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**Limit** | **int32** | The number of results to return. +**Offset** | **int32** | The point in the list to begin retrieving results. +**AggregatedBy** | [**AggregatedBy3**](AggregatedBy3AggregatedBy3.md) | How to group the statistics. Must be either \"day\", \"week\", or \"month\". +**EndDate** | **string** | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + +### Return type + +[**[]ListGeoStat200ResponseInner**](ListGeoStat200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/stats/docs/ListGeoStat200ResponseInner.md b/rest/api/v3/stats/docs/ListGeoStat200ResponseInner.md new file mode 100644 index 00000000..b8b712fe --- /dev/null +++ b/rest/api/v3/stats/docs/ListGeoStat200ResponseInner.md @@ -0,0 +1,12 @@ +# ListGeoStat200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Date** | **string** | The date that the statistics were gathered. |[optional] +**Stats** | [**[]ListGeoStat200ResponseInnerStatsInner**](ListGeoStat200ResponseInnerStatsInner.md) | The list of statistics. |[optional] + +[[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/rest/api/v3/stats/docs/ListGeoStat200ResponseInnerStatsInner.md b/rest/api/v3/stats/docs/ListGeoStat200ResponseInnerStatsInner.md new file mode 100644 index 00000000..059cb893 --- /dev/null +++ b/rest/api/v3/stats/docs/ListGeoStat200ResponseInnerStatsInner.md @@ -0,0 +1,13 @@ +# ListGeoStat200ResponseInnerStatsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | The type of segmentation. |[optional] +**Name** | **string** | The name of the specific segmentation. |[optional] +**Metrics** | [**AdvancedStatsClicksOpens**](AdvancedStatsClicksOpens.md) | |[optional] + +[[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/rest/api/v3/stats/docs/ListMailboxProviderStat.md b/rest/api/v3/stats/docs/ListMailboxProviderStat.md new file mode 100644 index 00000000..6500d3a7 --- /dev/null +++ b/rest/api/v3/stats/docs/ListMailboxProviderStat.md @@ -0,0 +1,53 @@ +# ListMailboxProviderStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListMailboxProviderStat**](ListMailboxProviderStat.md#ListMailboxProviderStat) | **Get** /v3/mailbox_providers/stats | Retrieve email statistics by mailbox provider. + + + +## ListMailboxProviderStat + +> []ListMailboxProviderStat200ResponseInner ListMailboxProviderStat(ctx, StartDateoptional) + +Retrieve email statistics by mailbox provider. + +**This endpoint allows you to retrieve your email statistics segmented by recipient mailbox provider.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListMailboxProviderStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**MailboxProviders** | **string** | The mail box providers to get statistics for. You can include up to 10 by including this parameter multiple times. +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**Limit** | **int32** | The number of results to return. +**Offset** | **int32** | The point in the list to begin retrieving results. +**AggregatedBy** | [**AggregatedBy3**](AggregatedBy3AggregatedBy3.md) | How to group the statistics. Must be either \"day\", \"week\", or \"month\". +**EndDate** | **string** | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + +### Return type + +[**[]ListMailboxProviderStat200ResponseInner**](ListMailboxProviderStat200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/stats/docs/ListMailboxProviderStat200ResponseInner.md b/rest/api/v3/stats/docs/ListMailboxProviderStat200ResponseInner.md new file mode 100644 index 00000000..0e9cf740 --- /dev/null +++ b/rest/api/v3/stats/docs/ListMailboxProviderStat200ResponseInner.md @@ -0,0 +1,12 @@ +# ListMailboxProviderStat200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Date** | **string** | The date that the statistics were gathered. |[optional] +**Stats** | [**[]ListMailboxProviderStat200ResponseInnerStatsInner**](ListMailboxProviderStat200ResponseInnerStatsInner.md) | The list of statistics. |[optional] + +[[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/rest/api/v3/stats/docs/ListMailboxProviderStat200ResponseInnerStatsInner.md b/rest/api/v3/stats/docs/ListMailboxProviderStat200ResponseInnerStatsInner.md new file mode 100644 index 00000000..73748c49 --- /dev/null +++ b/rest/api/v3/stats/docs/ListMailboxProviderStat200ResponseInnerStatsInner.md @@ -0,0 +1,13 @@ +# ListMailboxProviderStat200ResponseInnerStatsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | The type of segmentation. |[optional] +**Name** | **string** | The name of the specific segmentation. |[optional] +**Metrics** | [**AdvancedStatsMailboxProvider**](AdvancedStatsMailboxProvider.md) | |[optional] + +[[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/rest/api/v3/stats/docs/ListStat.md b/rest/api/v3/stats/docs/ListStat.md new file mode 100644 index 00000000..b0afdd99 --- /dev/null +++ b/rest/api/v3/stats/docs/ListStat.md @@ -0,0 +1,52 @@ +# ListStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListStat**](ListStat.md#ListStat) | **Get** /v3/stats | Retrieve global email statistics + + + +## ListStat + +> []ListStat200ResponseInner ListStat(ctx, StartDateoptional) + +Retrieve global email statistics + +**This endpoint allows you to retrieve all of your global email statistics between a given date range.** Parent accounts can see either aggregated stats for the parent account or aggregated stats for a subuser specified in the `on-behalf-of` header. Subuser accounts will see only their own stats. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**Limit** | **int32** | The number of results to return. +**Offset** | **int32** | The point in the list to begin retrieving results. +**AggregatedBy** | [**AggregatedBy3**](AggregatedBy3AggregatedBy3.md) | How to group the statistics. Must be either \"day\", \"week\", or \"month\". +**EndDate** | **string** | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + +### Return type + +[**[]ListStat200ResponseInner**](ListStat200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### 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/rest/api/v3/stats/docs/ListStat200ResponseInner.md b/rest/api/v3/stats/docs/ListStat200ResponseInner.md new file mode 100644 index 00000000..e510d3d0 --- /dev/null +++ b/rest/api/v3/stats/docs/ListStat200ResponseInner.md @@ -0,0 +1,12 @@ +# ListStat200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Date** | **string** | The date the stats were gathered. | +**Stats** | [**[]ListStat200ResponseInnerStatsInner**](ListStat200ResponseInnerStatsInner.md) | The individual email activity stats. | + +[[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/rest/api/v3/stats/docs/ListStat200ResponseInnerStatsInner.md b/rest/api/v3/stats/docs/ListStat200ResponseInnerStatsInner.md new file mode 100644 index 00000000..7cfd11e2 --- /dev/null +++ b/rest/api/v3/stats/docs/ListStat200ResponseInnerStatsInner.md @@ -0,0 +1,11 @@ +# ListStat200ResponseInnerStatsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Metrics** | [**StatsAdvancedGlobalStats**](StatsAdvancedGlobalStats.md) | |[optional] + +[[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/rest/api/v3/stats/docs/SortByDirection.md b/rest/api/v3/stats/docs/SortByDirection.md new file mode 100644 index 00000000..0431e9a0 --- /dev/null +++ b/rest/api/v3/stats/docs/SortByDirection.md @@ -0,0 +1,13 @@ +# SortByDirection + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DESC** | string | (value: `"desc"`) +**ASC** | string | (value: `"asc"`) + + +[[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/rest/api/v3/stats/docs/StatsAdvancedGlobalStats.md b/rest/api/v3/stats/docs/StatsAdvancedGlobalStats.md new file mode 100644 index 00000000..cf8ff1d7 --- /dev/null +++ b/rest/api/v3/stats/docs/StatsAdvancedGlobalStats.md @@ -0,0 +1,26 @@ +# StatsAdvancedGlobalStats + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Clicks** | **int32** | The number of links that were clicked in your emails. |[optional] +**UniqueClicks** | **int32** | The number of unique recipients who clicked links in your emails. |[optional] +**Opens** | **int32** | The total number of times your emails were opened by recipients. |[optional] +**UniqueOpens** | **int32** | The number of unique recipients who opened your emails. |[optional] +**Blocks** | **int32** | The number of emails that were not allowed to be delivered by ISPs. |[optional] +**BounceDrops** | **int32** | The number of emails that were dropped because of a bounce. |[optional] +**Bounces** | **int32** | The number of emails that bounced instead of being delivered. |[optional] +**Deferred** | **int32** | The number of emails that temporarily could not be delivered. |[optional] +**Delivered** | **int32** | The number of emails SendGrid was able to confirm were actually delivered to a recipient. |[optional] +**InvalidEmails** | **int32** | The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid. |[optional] +**Processed** | **int32** | Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed. |[optional] +**Requests** | **int32** | The number of emails that were requested to be delivered. |[optional] +**SpamReportDrops** | **int32** | The number of emails that were dropped due to a recipient previously marking your emails as spam. |[optional] +**SpamReports** | **int32** | The number of recipients who marked your email as spam. |[optional] +**UnsubscribeDrops** | **int32** | The number of emails dropped due to a recipient unsubscribing from your emails. |[optional] +**Unsubscribes** | **int32** | The number of recipients who unsubscribed from your emails. |[optional] + +[[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/rest/api/v3/stats/model_advanced_stats_clicks.go b/rest/api/v3/stats/model_advanced_stats_clicks.go new file mode 100644 index 00000000..e26aca54 --- /dev/null +++ b/rest/api/v3/stats/model_advanced_stats_clicks.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AdvancedStatsClicks The individual events and their stats. +type AdvancedStatsClicks struct { + // The number of links that were clicked in your emails. + Clicks *int32 `json:"clicks,omitempty"` + // The number of unique recipients who clicked links in your emails. + UniqueClicks *int32 `json:"unique_clicks,omitempty"` +} diff --git a/rest/api/v3/stats/model_advanced_stats_clicks_opens.go b/rest/api/v3/stats/model_advanced_stats_clicks_opens.go new file mode 100644 index 00000000..a8a339f8 --- /dev/null +++ b/rest/api/v3/stats/model_advanced_stats_clicks_opens.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AdvancedStatsClicksOpens The individual events and their stats. +type AdvancedStatsClicksOpens struct { + // The number of links that were clicked in your emails. + Clicks *int32 `json:"clicks,omitempty"` + // The number of unique recipients who clicked links in your emails. + UniqueClicks *int32 `json:"unique_clicks,omitempty"` + // The total number of times your emails were opened by recipients. + Opens *int32 `json:"opens,omitempty"` + // The number of unique recipients who opened your emails. + UniqueOpens *int32 `json:"unique_opens,omitempty"` +} diff --git a/rest/api/v3/stats/model_advanced_stats_mailbox_provider.go b/rest/api/v3/stats/model_advanced_stats_mailbox_provider.go new file mode 100644 index 00000000..ee75f598 --- /dev/null +++ b/rest/api/v3/stats/model_advanced_stats_mailbox_provider.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AdvancedStatsMailboxProvider The individual events and their stats. +type AdvancedStatsMailboxProvider struct { + // The number of emails that were not allowed to be delivered by ISPs. + Blocks *int32 `json:"blocks,omitempty"` + // The number of emails that bounced instead of being delivered. + Bounces *int32 `json:"bounces,omitempty"` + // The number of emails that temporarily could not be delivered. + Deferred *int32 `json:"deferred,omitempty"` + // The number of emails SendGrid was able to confirm were actually delivered to a recipient. + Delivered *int32 `json:"delivered,omitempty"` + // The number of emails that were not delivered due to the recipient email address being on a suppression list. + Drops *int32 `json:"drops,omitempty"` + // The number of emails that were requested to be delivered. + Requests *int32 `json:"requests,omitempty"` + // Requests from your website, application, or mail client via SMTP Relay or the Web API that SendGrid processed. + Processed *int32 `json:"processed,omitempty"` + // The number of recipients who marked your email as spam. + SpamReports *int32 `json:"spam_reports,omitempty"` +} diff --git a/rest/api/v3/stats/model_advanced_stats_opens.go b/rest/api/v3/stats/model_advanced_stats_opens.go new file mode 100644 index 00000000..8af689e0 --- /dev/null +++ b/rest/api/v3/stats/model_advanced_stats_opens.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AdvancedStatsOpens The individual events and their stats. +type AdvancedStatsOpens struct { + // The total number of times your emails were opened by recipients. + Opens *int32 `json:"opens,omitempty"` + // The number of unique recipients who opened your emails. + UniqueOpens *int32 `json:"unique_opens,omitempty"` +} diff --git a/rest/api/v3/stats/model_aggregated_by.go b/rest/api/v3/stats/model_aggregated_by.go new file mode 100644 index 00000000..7030e628 --- /dev/null +++ b/rest/api/v3/stats/model_aggregated_by.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AggregatedBy the model 'AggregatedBy' +type AggregatedBy string + +// List of AggregatedBy +const ( + AGGREGATEDBY_DAY AggregatedBy = "day" + AGGREGATEDBY_WEEK AggregatedBy = "week" + AGGREGATEDBY_MONTH AggregatedBy = "month" +) diff --git a/rest/api/v3/stats/model_aggregated_by1.go b/rest/api/v3/stats/model_aggregated_by1.go new file mode 100644 index 00000000..1d03db31 --- /dev/null +++ b/rest/api/v3/stats/model_aggregated_by1.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AggregatedBy1 the model 'AggregatedBy1' +type AggregatedBy1 string + +// List of AggregatedBy1 +const ( + AGGREGATEDBY1_DAY AggregatedBy1 = "day" + AGGREGATEDBY1_WEEK AggregatedBy1 = "week" + AGGREGATEDBY1_MONTH AggregatedBy1 = "month" +) diff --git a/rest/api/v3/stats/model_aggregated_by2.go b/rest/api/v3/stats/model_aggregated_by2.go new file mode 100644 index 00000000..d9a0ac73 --- /dev/null +++ b/rest/api/v3/stats/model_aggregated_by2.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AggregatedBy2 the model 'AggregatedBy2' +type AggregatedBy2 string + +// List of AggregatedBy2 +const ( + AGGREGATEDBY2_DAY AggregatedBy2 = "day" + AGGREGATEDBY2_WEEK AggregatedBy2 = "week" + AGGREGATEDBY2_MONTH AggregatedBy2 = "month" +) diff --git a/rest/api/v3/stats/model_aggregated_by3.go b/rest/api/v3/stats/model_aggregated_by3.go new file mode 100644 index 00000000..f5d4b9e4 --- /dev/null +++ b/rest/api/v3/stats/model_aggregated_by3.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AggregatedBy3 the model 'AggregatedBy3' +type AggregatedBy3 string + +// List of AggregatedBy3 +const ( + AGGREGATEDBY3_DAY AggregatedBy3 = "day" + AGGREGATEDBY3_WEEK AggregatedBy3 = "week" + AGGREGATEDBY3_MONTH AggregatedBy3 = "month" +) diff --git a/rest/api/v3/stats/model_category_stats.go b/rest/api/v3/stats/model_category_stats.go new file mode 100644 index 00000000..67f280ca --- /dev/null +++ b/rest/api/v3/stats/model_category_stats.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CategoryStats struct for CategoryStats +type CategoryStats struct { + // The date the statistics were gathered. + Date string `json:"date"` + Stats *[]CategoryStatsStatsInner `json:"stats,omitempty"` +} diff --git a/rest/api/v3/stats/model_category_stats_stats_inner.go b/rest/api/v3/stats/model_category_stats_stats_inner.go new file mode 100644 index 00000000..9484fa58 --- /dev/null +++ b/rest/api/v3/stats/model_category_stats_stats_inner.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CategoryStatsStatsInner struct for CategoryStatsStatsInner +type CategoryStatsStatsInner struct { + Metrics *CategoryStatsStatsInnerMetrics `json:"metrics,omitempty"` + // The name of the category. + Name *string `json:"name,omitempty"` + // How you are segmenting your statistics. + Type string `json:"type"` +} diff --git a/rest/api/v3/stats/model_category_stats_stats_inner_metrics.go b/rest/api/v3/stats/model_category_stats_stats_inner_metrics.go new file mode 100644 index 00000000..99765698 --- /dev/null +++ b/rest/api/v3/stats/model_category_stats_stats_inner_metrics.go @@ -0,0 +1,50 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CategoryStatsStatsInnerMetrics struct for CategoryStatsStatsInnerMetrics +type CategoryStatsStatsInnerMetrics struct { + // The number of emails that were not allowed to be delivered by ISPs. + Blocks int32 `json:"blocks"` + // The number of emails that were dropped because of a bounce. + BounceDrops int32 `json:"bounce_drops"` + // The number of emails that bounced instead of being delivered. + Bounces int32 `json:"bounces"` + // The number of links that were clicked. + Clicks int32 `json:"clicks"` + // The number of emails that temporarily could not be delivered. + Deferred int32 `json:"deferred"` + // The number of emails SendGrid was able to confirm were actually delivered to a recipient. + Delivered int32 `json:"delivered"` + // The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid. + InvalidEmails int32 `json:"invalid_emails"` + // The total number of times your emails were opened by recipients. + Opens int32 `json:"opens"` + // Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed. + Processed int32 `json:"processed"` + // The number of emails that were requested to be delivered. + Requests int32 `json:"requests"` + // The number of emails that were dropped due to a recipient previously marking your emails as spam. + SpamReportDrops int32 `json:"spam_report_drops"` + // The number of recipients who marked your email as spam. + SpamReports int32 `json:"spam_reports"` + // The number of unique recipients who clicked links in your emails. + UniqueClicks int32 `json:"unique_clicks"` + // The number of unique recipients who opened your emails. + UniqueOpens int32 `json:"unique_opens"` + // The number of emails dropped due to a recipient unsubscribing from your emails. + UnsubscribeDrops int32 `json:"unsubscribe_drops"` + // The number of recipients who unsubscribed from your emails. + Unsubscribes int32 `json:"unsubscribes"` +} diff --git a/rest/api/v3/stats/model_client_type.go b/rest/api/v3/stats/model_client_type.go new file mode 100644 index 00000000..3c36ab04 --- /dev/null +++ b/rest/api/v3/stats/model_client_type.go @@ -0,0 +1,25 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ClientType the model 'ClientType' +type ClientType string + +// List of ClientType +const ( + CLIENTTYPE_PHONE ClientType = "phone" + CLIENTTYPE_TABLET ClientType = "tablet" + CLIENTTYPE_WEBMAIL ClientType = "webmail" + CLIENTTYPE_DESKTOP ClientType = "desktop" +) diff --git a/rest/api/v3/stats/model_country.go b/rest/api/v3/stats/model_country.go new file mode 100644 index 00000000..867da48a --- /dev/null +++ b/rest/api/v3/stats/model_country.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Country the model 'Country' +type Country string + +// List of Country +const ( + COUNTRY_US Country = "US" + COUNTRY_CA Country = "CA" +) diff --git a/rest/api/v3/stats/model_list_browser_stat_200_response_inner.go b/rest/api/v3/stats/model_list_browser_stat_200_response_inner.go new file mode 100644 index 00000000..6abdbd78 --- /dev/null +++ b/rest/api/v3/stats/model_list_browser_stat_200_response_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListBrowserStat200ResponseInner struct for ListBrowserStat200ResponseInner +type ListBrowserStat200ResponseInner struct { + // The date that the statistics were gathered. + Date *string `json:"date,omitempty"` + // The list of statistics. + Stats *[]ListBrowserStat200ResponseInnerStatsInner `json:"stats,omitempty"` +} diff --git a/rest/api/v3/stats/model_list_browser_stat_200_response_inner_stats_inner.go b/rest/api/v3/stats/model_list_browser_stat_200_response_inner_stats_inner.go new file mode 100644 index 00000000..b33842eb --- /dev/null +++ b/rest/api/v3/stats/model_list_browser_stat_200_response_inner_stats_inner.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListBrowserStat200ResponseInnerStatsInner struct for ListBrowserStat200ResponseInnerStatsInner +type ListBrowserStat200ResponseInnerStatsInner struct { + // The type of segmentation. + Type *string `json:"type,omitempty"` + // The name of the specific segmentation. + Name *string `json:"name,omitempty"` + Metrics *AdvancedStatsClicks `json:"metrics,omitempty"` +} diff --git a/rest/api/v3/stats/model_list_category_200_response_inner.go b/rest/api/v3/stats/model_list_category_200_response_inner.go new file mode 100644 index 00000000..8b6aa73d --- /dev/null +++ b/rest/api/v3/stats/model_list_category_200_response_inner.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListCategory200ResponseInner struct for ListCategory200ResponseInner +type ListCategory200ResponseInner struct { + // A category used to group emails by broad topic. + Category string `json:"category"` +} diff --git a/rest/api/v3/stats/model_list_category_400_response.go b/rest/api/v3/stats/model_list_category_400_response.go new file mode 100644 index 00000000..1ddd6eb7 --- /dev/null +++ b/rest/api/v3/stats/model_list_category_400_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListCategory400Response struct for ListCategory400Response +type ListCategory400Response struct { + // The error returned. + Errors *[]ListCategory400ResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/stats/model_list_category_400_response_errors_inner.go b/rest/api/v3/stats/model_list_category_400_response_errors_inner.go new file mode 100644 index 00000000..33dbbfe5 --- /dev/null +++ b/rest/api/v3/stats/model_list_category_400_response_errors_inner.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListCategory400ResponseErrorsInner struct for ListCategory400ResponseErrorsInner +type ListCategory400ResponseErrorsInner struct { + Field string `json:"field"` + // A message explaining why your categories could not be retrieved. + Message string `json:"message"` +} diff --git a/rest/api/v3/stats/model_list_client_stat_200_response_inner.go b/rest/api/v3/stats/model_list_client_stat_200_response_inner.go new file mode 100644 index 00000000..f7f802fd --- /dev/null +++ b/rest/api/v3/stats/model_list_client_stat_200_response_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListClientStat200ResponseInner struct for ListClientStat200ResponseInner +type ListClientStat200ResponseInner struct { + // The date that the statistics were gathered. + Date *string `json:"date,omitempty"` + // The list of statistics. + Stats *[]ListClientStat200ResponseInnerStatsInner `json:"stats,omitempty"` +} diff --git a/rest/api/v3/stats/model_list_client_stat_200_response_inner_stats_inner.go b/rest/api/v3/stats/model_list_client_stat_200_response_inner_stats_inner.go new file mode 100644 index 00000000..fc6e6ec6 --- /dev/null +++ b/rest/api/v3/stats/model_list_client_stat_200_response_inner_stats_inner.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListClientStat200ResponseInnerStatsInner struct for ListClientStat200ResponseInnerStatsInner +type ListClientStat200ResponseInnerStatsInner struct { + // The type of segmentation. + Type *string `json:"type,omitempty"` + // The name of the specific segmentation. + Name *string `json:"name,omitempty"` + Metrics *AdvancedStatsOpens `json:"metrics,omitempty"` +} diff --git a/rest/api/v3/stats/model_list_geo_stat_200_response_inner.go b/rest/api/v3/stats/model_list_geo_stat_200_response_inner.go new file mode 100644 index 00000000..2c097da9 --- /dev/null +++ b/rest/api/v3/stats/model_list_geo_stat_200_response_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListGeoStat200ResponseInner struct for ListGeoStat200ResponseInner +type ListGeoStat200ResponseInner struct { + // The date that the statistics were gathered. + Date *string `json:"date,omitempty"` + // The list of statistics. + Stats *[]ListGeoStat200ResponseInnerStatsInner `json:"stats,omitempty"` +} diff --git a/rest/api/v3/stats/model_list_geo_stat_200_response_inner_stats_inner.go b/rest/api/v3/stats/model_list_geo_stat_200_response_inner_stats_inner.go new file mode 100644 index 00000000..0b755f7e --- /dev/null +++ b/rest/api/v3/stats/model_list_geo_stat_200_response_inner_stats_inner.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListGeoStat200ResponseInnerStatsInner struct for ListGeoStat200ResponseInnerStatsInner +type ListGeoStat200ResponseInnerStatsInner struct { + // The type of segmentation. + Type *string `json:"type,omitempty"` + // The name of the specific segmentation. + Name *string `json:"name,omitempty"` + Metrics *AdvancedStatsClicksOpens `json:"metrics,omitempty"` +} diff --git a/rest/api/v3/stats/model_list_mailbox_provider_stat_200_response_inner.go b/rest/api/v3/stats/model_list_mailbox_provider_stat_200_response_inner.go new file mode 100644 index 00000000..94550611 --- /dev/null +++ b/rest/api/v3/stats/model_list_mailbox_provider_stat_200_response_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListMailboxProviderStat200ResponseInner struct for ListMailboxProviderStat200ResponseInner +type ListMailboxProviderStat200ResponseInner struct { + // The date that the statistics were gathered. + Date *string `json:"date,omitempty"` + // The list of statistics. + Stats *[]ListMailboxProviderStat200ResponseInnerStatsInner `json:"stats,omitempty"` +} diff --git a/rest/api/v3/stats/model_list_mailbox_provider_stat_200_response_inner_stats_inner.go b/rest/api/v3/stats/model_list_mailbox_provider_stat_200_response_inner_stats_inner.go new file mode 100644 index 00000000..049a1771 --- /dev/null +++ b/rest/api/v3/stats/model_list_mailbox_provider_stat_200_response_inner_stats_inner.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListMailboxProviderStat200ResponseInnerStatsInner struct for ListMailboxProviderStat200ResponseInnerStatsInner +type ListMailboxProviderStat200ResponseInnerStatsInner struct { + // The type of segmentation. + Type *string `json:"type,omitempty"` + // The name of the specific segmentation. + Name *string `json:"name,omitempty"` + Metrics *AdvancedStatsMailboxProvider `json:"metrics,omitempty"` +} diff --git a/rest/api/v3/stats/model_list_stat_200_response_inner.go b/rest/api/v3/stats/model_list_stat_200_response_inner.go new file mode 100644 index 00000000..ff32341b --- /dev/null +++ b/rest/api/v3/stats/model_list_stat_200_response_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListStat200ResponseInner struct for ListStat200ResponseInner +type ListStat200ResponseInner struct { + // The date the stats were gathered. + Date string `json:"date"` + // The individual email activity stats. + Stats []ListStat200ResponseInnerStatsInner `json:"stats"` +} diff --git a/rest/api/v3/stats/model_list_stat_200_response_inner_stats_inner.go b/rest/api/v3/stats/model_list_stat_200_response_inner_stats_inner.go new file mode 100644 index 00000000..5ff7e17f --- /dev/null +++ b/rest/api/v3/stats/model_list_stat_200_response_inner_stats_inner.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListStat200ResponseInnerStatsInner struct for ListStat200ResponseInnerStatsInner +type ListStat200ResponseInnerStatsInner struct { + Metrics *StatsAdvancedGlobalStats `json:"metrics,omitempty"` +} diff --git a/rest/api/v3/stats/model_sort_by_direction.go b/rest/api/v3/stats/model_sort_by_direction.go new file mode 100644 index 00000000..83900dd5 --- /dev/null +++ b/rest/api/v3/stats/model_sort_by_direction.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SortByDirection the model 'SortByDirection' +type SortByDirection string + +// List of SortByDirection +const ( + SORTBYDIRECTION_DESC SortByDirection = "desc" + SORTBYDIRECTION_ASC SortByDirection = "asc" +) diff --git a/rest/api/v3/stats/model_stats_advanced_global_stats.go b/rest/api/v3/stats/model_stats_advanced_global_stats.go new file mode 100644 index 00000000..1a7151de --- /dev/null +++ b/rest/api/v3/stats/model_stats_advanced_global_stats.go @@ -0,0 +1,50 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// StatsAdvancedGlobalStats struct for StatsAdvancedGlobalStats +type StatsAdvancedGlobalStats struct { + // The number of links that were clicked in your emails. + Clicks *int32 `json:"clicks,omitempty"` + // The number of unique recipients who clicked links in your emails. + UniqueClicks *int32 `json:"unique_clicks,omitempty"` + // The total number of times your emails were opened by recipients. + Opens *int32 `json:"opens,omitempty"` + // The number of unique recipients who opened your emails. + UniqueOpens *int32 `json:"unique_opens,omitempty"` + // The number of emails that were not allowed to be delivered by ISPs. + Blocks *int32 `json:"blocks,omitempty"` + // The number of emails that were dropped because of a bounce. + BounceDrops *int32 `json:"bounce_drops,omitempty"` + // The number of emails that bounced instead of being delivered. + Bounces *int32 `json:"bounces,omitempty"` + // The number of emails that temporarily could not be delivered. + Deferred *int32 `json:"deferred,omitempty"` + // The number of emails SendGrid was able to confirm were actually delivered to a recipient. + Delivered *int32 `json:"delivered,omitempty"` + // The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid. + InvalidEmails *int32 `json:"invalid_emails,omitempty"` + // Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed. + Processed *int32 `json:"processed,omitempty"` + // The number of emails that were requested to be delivered. + Requests *int32 `json:"requests,omitempty"` + // The number of emails that were dropped due to a recipient previously marking your emails as spam. + SpamReportDrops *int32 `json:"spam_report_drops,omitempty"` + // The number of recipients who marked your email as spam. + SpamReports *int32 `json:"spam_reports,omitempty"` + // The number of emails dropped due to a recipient unsubscribing from your emails. + UnsubscribeDrops *int32 `json:"unsubscribe_drops,omitempty"` + // The number of recipients who unsubscribed from your emails. + Unsubscribes *int32 `json:"unsubscribes,omitempty"` +}