From 4cffaa8b787c51f17bae05aafaa197d24bc76aa7 Mon Sep 17 00:00:00 2001 From: infobip-ci Date: Thu, 13 Apr 2023 15:04:49 +0000 Subject: [PATCH] Update to version 2.1.0 --- .gitignore | 1 + CHANGELOG.md | 16 + CONTRIBUTING.md | 26 +- README.md | 219 +++++----- v2/api_conversion.go | 161 +++++++ v2/api_receive_sms.go | 5 +- v2/api_scheduled_sms.go | 45 +- v2/api_send_sms.go | 78 ++-- v2/api_tfa.go | 86 ++-- v2/client.go | 6 +- v2/configuration.go | 3 +- v2/infobip.go | 3 +- v2/model_conversion_response.go | 114 +++++ v2/model_sms_advanced_binary_request.go | 9 +- v2/model_sms_advanced_textual_request.go | 88 +++- v2/model_sms_api_exception.go | 1 - v2/model_sms_api_request_error.go | 1 - v2/model_sms_api_request_error_details.go | 38 +- v2/model_sms_binary_content.go | 1 - v2/model_sms_binary_message.go | 101 ++++- v2/model_sms_bulk_request.go | 2 +- v2/model_sms_bulk_response.go | 5 +- v2/model_sms_bulk_status.go | 3 +- v2/model_sms_bulk_status_response.go | 2 +- v2/model_sms_delivery_day.go | 3 +- v2/model_sms_delivery_result.go | 1 - v2/model_sms_delivery_time.go | 7 +- v2/model_sms_delivery_time_window.go | 9 +- v2/model_sms_destination.go | 3 +- v2/model_sms_error.go | 77 ++-- v2/model_sms_inbound_message.go | 17 +- v2/model_sms_inbound_message_result.go | 10 +- v2/model_sms_india_dlt_options.go | 7 +- v2/model_sms_language.go | 3 +- v2/model_sms_language_configuration.go | 5 +- v2/model_sms_log.go | 15 +- v2/model_sms_logs_response.go | 1 - v2/model_sms_preview.go | 144 +++---- v2/model_sms_preview_request.go | 63 ++- v2/model_sms_preview_response.go | 5 +- v2/model_sms_price.go | 73 ++-- v2/model_sms_regional_options.go | 42 +- v2/model_sms_report.go | 408 ++++++++++-------- v2/model_sms_response.go | 5 +- v2/model_sms_response_details.go | 49 ++- v2/model_sms_sending_speed_limit.go | 12 +- v2/model_sms_speed_limit_time_unit.go | 3 +- v2/model_sms_status.go | 155 ++++--- v2/model_sms_textual_message.go | 112 ++++- v2/model_sms_tracking.go | 11 +- v2/model_sms_turkey_iys_options.go | 144 +++++++ v2/model_sms_update_status_request.go | 1 - v2/model_sms_url_options.go | 274 ++++++++++++ v2/model_tfa_api_exception.go | 1 - v2/model_tfa_api_request_error.go | 1 - v2/model_tfa_api_request_error_details.go | 1 - v2/model_tfa_application_configuration.go | 13 +- v2/model_tfa_application_request.go | 4 +- v2/model_tfa_application_response.go | 8 +- v2/model_tfa_create_message_request.go | 16 +- v2/model_tfa_india_dlt_options.go | 7 +- v2/model_tfa_language.go | 8 +- v2/model_tfa_message.go | 20 +- v2/model_tfa_pin_type.go | 3 +- v2/model_tfa_regional_options.go | 4 +- v2/model_tfa_resend_pin_request.go | 1 - v2/model_tfa_start_authentication_request.go | 5 +- v2/model_tfa_start_authentication_response.go | 5 +- v2/model_tfa_update_message_request.go | 18 +- v2/model_tfa_verification.go | 1 - v2/model_tfa_verification_response.go | 1 - v2/model_tfa_verify_pin_request.go | 3 +- v2/model_tfa_verify_pin_response.go | 5 +- v2/response.go | 1 - v2/time.go | 1 - v2/utils.go | 1 - 76 files changed, 1945 insertions(+), 856 deletions(-) create mode 100644 v2/api_conversion.go create mode 100644 v2/model_conversion_response.go create mode 100644 v2/model_sms_turkey_iys_options.go create mode 100644 v2/model_sms_url_options.go diff --git a/.gitignore b/.gitignore index daf913b..3a41bf0 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ # Folders _obj _test +.scannerwork # Architecture specific extensions/prefixes *.[568vq] diff --git a/CHANGELOG.md b/CHANGELOG.md index 6702125..de794a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,22 @@ All notable changes to the library will be documented in this file. The format of the file is based on [Keep a Changelog](http://keepachangelog.com/) and this library adheres to [Semantic Versioning](http://semver.org/) as mentioned in [README.md][readme] file. +## [[2.1.0](https://github.com/infobip/infobip-api-go-client/releases/tag/2.1.0)] - 2023-04-12 + +### Added +- Support for [Confirm Conversion API](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/log-end-tag) + +### Changed +- SMS models: + - Additional fields related to [CPaaS X](https://www.infobip.com/docs/cpaas-x): `EntityId` and `ApplicationId`. + - `UrlOptions` and `IncludeSMSCountInResponse` fields in `SmsAdvancedTextualRequest` model. + - `ValidationErrors` field in `SmsApiRequestErrorDetails` model. + - New regional options for sending promotional SMS to phone numbers registered in Turkey. + - New model `UrlOptions` for setting up URL shortening and tracking feature. +- TFA models: + - New languages support for sending text to speech messages: `hr`, `sl` and `ro`. + + ## [ [2.0.0](https://github.com/infobip/infobip-api-go-client/releases/tag/2.0.0) ] - 2021-06-30 🎉 **NEW Major Version of `infobip`.** diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ad58b1a..c516bdf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,32 +1,32 @@ # Getting Involved -Thanks for your interest in the project, we'd love to have you involved! Check out the sections below to find out more about what to do next... +Thanks for your interest in the project, we'd love to have you involved! Check out sections below to find out more about what to do next... ## Submitting an Issue -If you've seen something that is or might seem like a bug or a mistake in the documentation, or you simply have a suggestion for a new feature, please go ahead and open us [an issue][issue-link]. +If you've seen something that is or may seem like a bug or a mistake in documentation, or you simply have a suggestion for a new feature, please go ahead and open [an issue][issue-link]. Include as much information as you have. -Before you submit your issue please do the archive search first, maybe the same question was already answered or is pending. +Before you submit your issue, please do the archive search first, as there may be a similar question that's already been answered or is pending a response. -If you did not find a related issue among the already asked, feel free to open a new issue. +If you haven't found any related issues among the already asked, feel free to open a new one. -For new feature requests, any sort of bug, anomaly, issue etc. please try to provide us structured information as listed below. -You don't have to follow it to the letter but having it structured like below may save us a lot of time to pinpoint and fix the issue quicker. +For new feature requests, any sort of bug, anomaly, issue, etc. please try to provide information, as structured below. +You don't have to follow it to the letter, but having it structured like below may save us a lot of time to pinpoint and fix the issue quicker. ### New issue structure (bugs, anomalies, improvements...) Providing the following information will increase the chances of your issue being dealt with quickly: -* **Short TO-THE-POINT Overview** - what seems to be the issue +* **Short TO-THE-POINT Overview** - what seems to be the issue. * **Description** - more detailed explanation of the issue. The stack trace in cases where it is applicable. -* **Which `infobip` version(s)** - which library version(s) did you used when occurred with this issue. -* **Environment** - is this a problem with all development/testing/production environments or only specific one(s)? -* **Reproducing** - how did it happen? Is it an isolated anomaly, can you reproduce it, what are the steps to reproduce it? +* **Which `infobip` version(s)** - which library version(s) did you use when the issue occurred. +* **Environment** - is this a problem with all development/testing/production environments or only a specific one(s)? +* **Reproducing** - how did it happen? Is it an isolated anomaly, can you recreate it, what are the steps to recreate it? * **Related Issues** - is there something similar to this issue that has been reported before? If so, please tag that issue(s) as a reference. -* **Suggest a Fix** - this code is generated, but perhaps you can point to the part of the code that might be causing the bug. +* **Suggest a Fix** - this code is auto generated, but perhaps you can provide us with your code sample as a fix to the part of the code that is causing the bug. ## Pull requests disclaimer -We will not be accepting pull requests. However, because source code within this repository is **generated**, hence the changes will need to be made by us within library generation configuration. -Having said that, we still fully do encourage you to submit an issue since that will help us track it and keep you up-to-date. +We will not be accepting any pull requests, as the source code within this repository is **auto generated**. Any change needs to be made by us within the library generation configuration. +Having said that, we still fully encourage you to submit an issue, since that will help us track it and keep you up to date. [issue-link]: https://github.com/infobip/infobip-api-go-client/issues/new diff --git a/README.md b/README.md index d79e426..9ab81e8 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,12 @@ [![Go Reference](https://pkg.go.dev/badge/github.com/infobip/infobip-api-go-client.svg)](https://pkg.go.dev/github.com/infobip/infobip-api-go-client) [![MIT License](https://badgen.net/github/license/infobip/infobip-api-go-client)](https://opensource.org/licenses/MIT) -This is a Go module for Infobip API and you can use it as a dependency to add [Infobip APIs][apidocs] to your application. -To use this, you'll need an Infobip account. If not already having one, you can create a [free trial][freetrial] account [here][signup]. +This is a Go module for Infobip API and you can use it as a dependency when you want to consume [Infobip APIs][apidocs] in your application. +To use this, you'll need an Infobip account. You can create a [free trial][freetrial] account [here][signup]. -Built on top of [OpenAPI Specification](https://swagger.io/specification/), powered by [OpenAPI Generator](https://openapi-generator.tech/). +`infobip-api-go-client` is built on top of [OpenAPI Specification](https://swagger.io/specification/), powered by [OpenAPI Generator](https://openapi-generator.tech/). -Infobip +Infobip #### Table of contents: * [Documentation](#documentation) @@ -19,7 +19,9 @@ Built on top of [OpenAPI Specification](https://swagger.io/specification/), powe ## Documentation -Infobip API Documentation can be found [here][apidocs]. +Detailed documentation about Infobip API can be found [here][apidocs]. +The current version of this library includes this subset of Infobip products: +* [SMS](https://www.infobip.com/docs/api/channels/sms) ## General Info For `infobip-api-go-client` versioning we use [Semantic Versioning][semver] scheme. @@ -48,116 +50,117 @@ go mod tidy #### Initialize the Client -In order to initialize the client first you need to set some basics like configuration and authentication. +In order to initialize the client first you need to set some basics like configuration and authentication. We support multiple authentication methods, e.g. you can use [API Key](https://www.infobip.com/docs/essentials/api-authentication#api-key-header) or any of the other supported approaches. +Once you have an [Infobip account](https://www.infobip.com/signup), you can manage your API keys through the Infobip [API key management](https://portal.infobip.com/settings/accounts/api-keys) page. -To see your base URL, log in to the [Infobip API Resource][apidocs] hub with your Infobip credentials. +To see your base URL, log in to the [Infobip API Resource][apidocs] hub with your Infobip credentials or visit your [Infobip account](https://portal.infobip.com/homepage/). Let's first set the configuration field. ```go - configuration := infobip.NewConfiguration() - configuration.Host = "" +configuration := infobip.NewConfiguration() +configuration.Host = "" ``` Now you can initialize the API client. ```go - infobipClient := infobip.NewAPIClient(configuration) +infobipClient := infobip.NewAPIClient(configuration) ``` +For details, check the [client](https://github.com/infobip/infobip-api-go-client/blob/master/v2/client.go) source code. + #### Authentication After that is done, we should set the authentication method. There are several ways how that can be done. -If you prefer to use Basic Auth: +* If you prefer to use Basic Auth: ```go - auth := context.WithValue(context.Background(), infobip.ContextBasicAuth, infobip.BasicAuth{ - UserName: "", - Password: "", - }) +auth := context.WithValue(context.Background(), infobip.ContextBasicAuth, infobip.BasicAuth{ + UserName: "", + Password: "", +}) ``` -If you prefer to use Api Key: +* If you prefer to use Api Key: ```go - auth := context.WithValue(context.Background(), infobip.ContextAPIKey, "") +auth := context.WithValue(context.Background(), infobip.ContextAPIKey, "") ``` -If you prefer to use IBSSO token: -```go - auth := context.WithValue(context.Background(), infobip.ContextIBSSO, "") -``` - -Or you might want to use Infobip generated OAuth2 token: -```go - auth := context.WithValue(context.Background(), infobip.ContextAccessToken, "") -``` To understand how to generate above mentioned tokens, check [this](https://www.infobip.com/docs/essentials/api-authentication) page. In order to use the `auth` you need to provide it as a param to the endpoint you are triggering, eg. ```go - apiResponse, httpResponse, err := infobipClient. - SendSmsApi. - GetOutboundSmsMessageLogs(auth). - From(""). - Execute() +apiResponse, httpResponse, err := infobipClient. + SendSmsApi. + GetOutboundSmsMessageLogs(auth). + From(""). + Execute() ``` That is it, now you are set to use the API. #### Send an SMS -Simple example for sending an SMS message. +See below, a simple example of sending a single SMS message to single recipient. ```go - request := infobip.NewSmsAdvancedTextualRequest() +request := infobip.NewSmsAdvancedTextualRequest() + +destination := infobip.NewSmsDestination("41793026727") - destination := infobip.NewSmsDestination("41793026727") +from := "InfoSMS" +text := "This is a dummy SMS message" +message := infobip.NewSmsTextualMessage() +message.From = &from +message.Destinations = &[]infobip.SmsDestination{*destination} +message.Text = &text - from := "InfoSMS" - text := "This is a dummy SMS message" - message := infobip.NewSmsTextualMessage() - message.From = &from - message.Destinations = &[]infobip.SmsDestination{*destination} - message.Text = &text +request.SetMessages([]infobip.SmsTextualMessage{*message}) ``` Send the message and inspect the `err` field for more information in case of failure. You can get the HTTP status code from `httpResponse` property, and more details about error from `ErrorContent` property. ```go - apiResponse, httpResponse, err := infobipClient. - SendSmsApi. - SendSmsMessage(auth). - SmsAdvancedTextualRequest(*request). - Execute() - - // If, for any reason, you don't want to use some of the response fields, feel free to replace them with an underscore wildcard, eg. - // apiResponse, _, _ := ... +apiResponse, httpResponse, err := infobipClient. + SendSmsApi. + SendSmsMessage(auth). + SmsAdvancedTextualRequest(*request). + Execute() + +// If, for any reason, you don't want to use some of the response fields, feel free to replace them with an underscore wildcard, eg. +// apiResponse, _, _ := ... ``` -In order to be able to access our generated `Exception` models you will have to do a little bit of type casting. -Methods provided within `ServiceException` object are `GetMessageId()` and `GetText()` referring to the nature of the exception. +In order to be able to access our generated `Expecption` models, you will have to do a little bit of type casting. +Methods provided within `ServiceException` object are `GetMessageId()` and `GetText()` referring to the nature of the exception. Withing the `_nethttp.Response` response field (in example labeled as `httpResponse`) you can find pretty much everything that is referring to the HTTP status, e.g. `Status`, `StatusCode`, `Body`, `Header`, etc. ```go - if err != nil { - apiErr, isApiErr := err.(infobip.GenericOpenAPIError) - if isApiErr { - ibErr, isIbErr := apiErr.Model().(infobip.SmsApiException) - if isIbErr { - ibErr.RequestError.ServiceException.GetMessageId() - ibErr.RequestError.ServiceException.GetText() - } +if err != nil { + apiErr, isApiErr := err.(infobip.GenericOpenAPIError) + if isApiErr { + ibErr, isIbErr := apiErr.Model().(infobip.SmsApiException) + if isIbErr { + errMessageId := ibErr.RequestError.ServiceException.GetMessageId() + errText := ibErr.RequestError.ServiceException.GetText() + // HANDLE THE IB ERROR EXCEPTION + } else { + // HANDLE THE API ERROR EXCEPTION } - return + } else { + // HANDLE THE EXCEPTION } + return +} ``` -Additionally, from the successful response (`SmsResponse` object) you can pull out the `bulkId` and `messageId`(s) and use them to fetch a delivery report for given message or bulk. -Bulk ID will be received only when you send a message to more than one destination address or multiple messages in a single request. +Additionally, you can retrieve a the `bulkId` and `messageId` from the successful response (`SmsResponse` object) to use for fetching a delivery report for a given message or a bulk. +Bulk ID is received only when you send a message to more than one destination address or send multiple messages in a single request. ```go - bulkId := *apiResponse.BulkId - messageId := *apiResponse.Messages[0].MessageId +bulkId := *apiResponse.BulkId +messageId := *apiResponse.Messages[0].MessageId ``` #### Receive sent SMS report @@ -167,17 +170,29 @@ e.g. `https://{yourDomain}/delivery-reports` Example of webhook implementation: ```go - func DeliveryReports(w http.ResponseWriter, req *http.Request) { - reqBody, _ := ioutil.ReadAll(req.Body) - var report SmsDeliveryResult - json.Unmarshal(reqBody, &report) - fmt.Fprintf("Delivery report: %s", report) +func deliveryReports(w http.ResponseWriter, req *http.Request) { + reqBody, _ := ioutil.ReadAll(req.Body) + var report infobip.SmsDeliveryResult + err := json.Unmarshal(reqBody, &report) + if err != nil { + fmt.Println("Error:", err) + return } - func main() { - http.HandleFunc("/delivery-reports", deliveryReports) + if report.HasResults() { + results := report.GetResults() + for _, result := range results { + status := result.GetStatus() + fmt.Println(fmt.Sprintf("%s - %s", result.GetMessageId(), status.GetName())) + } } +} + +func main() { + http.HandleFunc("/delivery-reports", deliveryReports) +} ``` + If you prefer to use your own serializer, please pay attention to the supported [date format](https://www.infobip.com/docs/essentials/integration-best-practices#date-formats). In this library, we are wrapping around the `time.Time` model with our own `infobip.Time` in order to enforce the time format to be serialized properly. @@ -186,31 +201,31 @@ If you are for any reason unable to receive real time delivery reports on your e Each request will return a batch of delivery reports - only once. ```go - limit := int32(10) - bulkId := "bulk-1234" - messageId := "msg-123" - - apiResponse, httpResponse, err := infobipClient. - SendSmsApi. - GetOutboundSmsMessageDeliveryReports(auth). - BulkId(bulkId). - MessageId(messageId). - Limit(limit). - Execute() +limit := int32(10) +bulkId := "bulk-1234" +messageId := "msg-123" + +apiResponse, httpResponse, err := infobipClient. + SendSmsApi. + GetOutboundSmsMessageDeliveryReports(auth). + BulkId(bulkId). + MessageId(messageId). + Limit(limit). + Execute() ``` #### Unicode & SMS preview Infobip API supports Unicode characters and automatically detects encoding. Unicode and non-standard GSM characters use additional space, avoid unpleasant surprises and check how different message configurations will affect your message text, number of characters and message parts. ```go - text := "Let's see how many characters will remain unused in this message." - request := *infobip.NewSmsPreviewRequest(text) - - apiResponse, httpResponse, err := infobipClient. - SendSmsApi. - PreviewSmsMessage(auth). - SmsPreviewRequest(request). - Execute() +text := "Let's see how many characters will remain unused in this message." +request := *infobip.NewSmsPreviewRequest(text) + +apiResponse, httpResponse, err := infobipClient. + SendSmsApi. + PreviewSmsMessage(auth). + SmsPreviewRequest(request). + Execute() ``` #### Receive incoming SMS @@ -220,16 +235,28 @@ e.g. `https://{yourDomain}/incoming-sms`. Example of webhook implementation: ```go - func IncomingSms(w http.ResponseWriter, req *http.Request) { - reqBody, _ := ioutil.ReadAll(req.Body) - var msg SmsInboundMessage - json.Unmarshal(reqBody, &msg) - fmt.Fprintf("Received message: %s", msg) +func incomingSms(w http.ResponseWriter, req *http.Request) { + reqBody, _ := ioutil.ReadAll(req.Body) + var result infobip.SmsInboundMessageResult + err := json.Unmarshal(reqBody, &result) + if err != nil { + fmt.Println("Error:", err) + return } - func main() { - http.HandleFunc("/incoming-sms", incomingSms) + + if result.HasResults() { + msgs := result.GetResults() + for _, msg := range msgs { + fmt.Println(fmt.Sprintf("%s - %s", msg.GetFrom(), msg.GetCleanText())) + } } +} + +func main() { + http.HandleFunc("/incoming-sms", incomingSms) +} ``` + #### Two-Factor Authentication (2FA) For 2FA quick start guide please check [these examples](two-factor-authentication.md). diff --git a/v2/api_conversion.go b/v2/api_conversion.go new file mode 100644 index 0000000..9457074 --- /dev/null +++ b/v2/api_conversion.go @@ -0,0 +1,161 @@ +/* + * Infobip Client API Libraries OpenAPI Specification + * + * OpenAPI specification containing public endpoints supported in client API libraries. + * + * Contact: support@infobip.com + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package infobip + +import ( + "bytes" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// ConversionApiService ConversionApi service +type ConversionApiService service + +type ApiConfirmConversionRequest struct { + ctx _context.Context + ApiService *ConversionApiService + messageId string +} + +func (r ApiConfirmConversionRequest) Execute() (ConversionResponse, *_nethttp.Response, error) { + return r.ApiService.ConfirmConversionExecute(r) +} + +/* + * ConfirmConversion Confirm conversion + * Use this endpoint to inform the Infobip platform about the successful conversion on your side. Infobip will use this information to monitor SMS performance and provide you with better service. To enable Conversion Tracking, set up the “tracking” object to “SMS” when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms) over HTTP API. +For more information, see: [Tracking Conversion](https://www.infobip.com/docs/sms/api#track-conversion). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param messageId ID of a converted message. + * @return ApiConfirmConversionRequest +*/ +func (a *ConversionApiService) ConfirmConversion(ctx _context.Context, messageId string) ApiConfirmConversionRequest { + return ApiConfirmConversionRequest{ + ApiService: a, + ctx: ctx, + messageId: messageId, + } +} + +/* + * Execute executes the request + * @return ConversionResponse + */ +func (a *ConversionApiService) ConfirmConversionExecute(r ApiConfirmConversionRequest) (ConversionResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ConversionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConversionApiService.ConfirmConversion") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ct/1/log/end/{messageId}" + localVarPath = strings.Replace(localVarPath, "{"+"messageId"+"}", _neturl.PathEscape(parameterToString(r.messageId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode >= 400 && localVarHTTPResponse.StatusCode <= 499 { + var v SmsApiException + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode >= 500 && localVarHTTPResponse.StatusCode <= 599 { + var v SmsApiException + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + var v ConversionResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/v2/api_receive_sms.go b/v2/api_receive_sms.go index 2e8af74..c20480a 100644 --- a/v2/api_receive_sms.go +++ b/v2/api_receive_sms.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -44,7 +43,7 @@ func (r ApiGetInboundSmsMessagesRequest) Execute() (SmsInboundMessageResult, *_n /* * GetInboundSmsMessages Get inbound SMS messages - * If for some reason you are unable to receive incoming SMS at the endpoint of your choice in real time, you can use this API call to fetch messages. Each request will return a batch of received messages - only once. The following API request will return only new messages that arrived since the last API request. + * If for some reason you are unable to receive incoming SMS to the endpoint of your choice in real time, you can use this API call to fetch messages. Each request will return a batch of received messages - only once. The API request will only return new messages that arrived since the last API request. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiGetInboundSmsMessagesRequest */ @@ -93,7 +92,7 @@ func (a *ReceiveSmsApiService) GetInboundSmsMessagesExecute(r ApiGetInboundSmsMe } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) diff --git a/v2/api_scheduled_sms.go b/v2/api_scheduled_sms.go index 58ec54f..2916ac5 100644 --- a/v2/api_scheduled_sms.go +++ b/v2/api_scheduled_sms.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -44,7 +43,7 @@ func (r ApiGetScheduledSmsMessagesRequest) Execute() (SmsBulkResponse, *_nethttp /* * GetScheduledSmsMessages Get scheduled SMS messages - * See the status and the scheduled time of your SMS messages. + * See all scheduled messages and their scheduled date and time. To schedule a message, use the `sendAt` field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message). * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiGetScheduledSmsMessagesRequest */ @@ -94,7 +93,7 @@ func (a *ScheduledSmsApiService) GetScheduledSmsMessagesExecute(r ApiGetSchedule } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -182,7 +181,7 @@ func (r ApiGetScheduledSmsMessagesStatusRequest) Execute() (SmsBulkStatusRespons /* * GetScheduledSmsMessagesStatus Get scheduled SMS messages status - * See the status of scheduled messages. + * See the status of scheduled messages. To schedule a message, use the `sendAt` field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message). * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiGetScheduledSmsMessagesStatusRequest */ @@ -232,7 +231,7 @@ func (a *ScheduledSmsApiService) GetScheduledSmsMessagesStatusExecute(r ApiGetSc } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -261,7 +260,7 @@ func (a *ScheduledSmsApiService) GetScheduledSmsMessagesStatusExecute(r ApiGetSc body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode >= 400 && localVarHTTPResponse.StatusCode <= 499 { + if localVarHTTPResponse.StatusCode == 400 { var v SmsApiException err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -271,7 +270,7 @@ func (a *ScheduledSmsApiService) GetScheduledSmsMessagesStatusExecute(r ApiGetSc newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode >= 500 && localVarHTTPResponse.StatusCode <= 599 { + if localVarHTTPResponse.StatusCode == 404 { var v SmsApiException err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -281,13 +280,15 @@ func (a *ScheduledSmsApiService) GetScheduledSmsMessagesStatusExecute(r ApiGetSc newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - var v SmsBulkStatusResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + if localVarHTTPResponse.StatusCode == 500 { + var v SmsApiException + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v } - newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -325,7 +326,7 @@ func (r ApiRescheduleSmsMessagesRequest) Execute() (SmsBulkResponse, *_nethttp.R /* * RescheduleSmsMessages Reschedule SMS messages - * Change the date and time for sending scheduled messages. + * Change the date and time of already scheduled messages. To schedule a message, use the `sendAt` field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message). * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiRescheduleSmsMessagesRequest */ @@ -363,10 +364,13 @@ func (a *ScheduledSmsApiService) RescheduleSmsMessagesExecute(r ApiRescheduleSms if r.bulkId == nil { return localVarReturnValue, nil, reportError("bulkId is required and must be specified") } + if r.smsBulkRequest == nil { + return localVarReturnValue, nil, reportError("smsBulkRequest is required and must be specified") + } localVarQueryParams.Add("bulkId", parameterToString(*r.bulkId, "")) // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -375,7 +379,7 @@ func (a *ScheduledSmsApiService) RescheduleSmsMessagesExecute(r ApiRescheduleSms } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -470,7 +474,7 @@ func (r ApiUpdateScheduledSmsMessagesStatusRequest) Execute() (SmsBulkStatusResp /* * UpdateScheduledSmsMessagesStatus Update scheduled SMS messages status - * Change status or completely cancel sending of scheduled messages. + * Change the status or completely cancel sending of scheduled messages. To schedule a message, use the `sendAt` field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message). * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiUpdateScheduledSmsMessagesStatusRequest */ @@ -508,10 +512,13 @@ func (a *ScheduledSmsApiService) UpdateScheduledSmsMessagesStatusExecute(r ApiUp if r.bulkId == nil { return localVarReturnValue, nil, reportError("bulkId is required and must be specified") } + if r.smsUpdateStatusRequest == nil { + return localVarReturnValue, nil, reportError("smsUpdateStatusRequest is required and must be specified") + } localVarQueryParams.Add("bulkId", parameterToString(*r.bulkId, "")) // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -520,7 +527,7 @@ func (a *ScheduledSmsApiService) UpdateScheduledSmsMessagesStatusExecute(r ApiUp } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) diff --git a/v2/api_send_sms.go b/v2/api_send_sms.go index b139124..ff1e5f8 100644 --- a/v2/api_send_sms.go +++ b/v2/api_send_sms.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -55,7 +54,7 @@ func (r ApiGetOutboundSmsMessageDeliveryReportsRequest) Execute() (SmsDeliveryRe /* * GetOutboundSmsMessageDeliveryReports Get outbound SMS message delivery reports - * If you are for any reason unable to receive real time delivery reports on your endpoint, you can use this API method to learn if and when the message has been delivered to the recipient. Each request will return a batch of delivery reports - only once. The following API request will return only new reports that arrived since the last API request. + * If you are for any reason unable to receive real-time delivery reports on your endpoint, you can use this API method to learn if and when the message has been delivered to the recipient. Each request will return a batch of delivery reports - only once. The following API request will return only new reports that arrived since the last API request in the last 48 hours. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiGetOutboundSmsMessageDeliveryReportsRequest */ @@ -110,7 +109,7 @@ func (a *SendSmsApiService) GetOutboundSmsMessageDeliveryReportsExecute(r ApiGet } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -139,7 +138,7 @@ func (a *SendSmsApiService) GetOutboundSmsMessageDeliveryReportsExecute(r ApiGet body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode >= 400 && localVarHTTPResponse.StatusCode <= 499 { + if localVarHTTPResponse.StatusCode == 400 { var v SmsApiException err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -149,7 +148,7 @@ func (a *SendSmsApiService) GetOutboundSmsMessageDeliveryReportsExecute(r ApiGet newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode >= 500 && localVarHTTPResponse.StatusCode <= 599 { + if localVarHTTPResponse.StatusCode == 500 { var v SmsApiException err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -157,15 +156,7 @@ func (a *SendSmsApiService) GetOutboundSmsMessageDeliveryReportsExecute(r ApiGet return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - var v SmsDeliveryResult - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -243,7 +234,7 @@ func (r ApiGetOutboundSmsMessageLogsRequest) Execute() (SmsLogsResponse, *_netht /* * GetOutboundSmsMessageLogs Get outbound SMS message logs - * You should use this method for displaying logs in the user interface or for some other less frequent usage. See [message delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports) if your use case is to verify message delivery. + * Use this method for displaying logs for example in the user interface. Available are the logs for the last 48 hours and you can only retrieve maximum of 1000 logs per call. See [message delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports) if your use case is to verify message delivery. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiGetOutboundSmsMessageLogsRequest */ @@ -335,7 +326,7 @@ func (a *SendSmsApiService) GetOutboundSmsMessageLogsExecute(r ApiGetOutboundSms } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -458,9 +449,12 @@ func (a *SendSmsApiService) PreviewSmsMessageExecute(r ApiPreviewSmsMessageReque localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.smsPreviewRequest == nil { + return localVarReturnValue, nil, reportError("smsPreviewRequest is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -469,7 +463,7 @@ func (a *SendSmsApiService) PreviewSmsMessageExecute(r ApiPreviewSmsMessageReque } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -500,7 +494,7 @@ func (a *SendSmsApiService) PreviewSmsMessageExecute(r ApiPreviewSmsMessageReque body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode >= 400 && localVarHTTPResponse.StatusCode <= 499 { + if localVarHTTPResponse.StatusCode == 400 { var v SmsApiException err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -510,7 +504,7 @@ func (a *SendSmsApiService) PreviewSmsMessageExecute(r ApiPreviewSmsMessageReque newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode >= 500 && localVarHTTPResponse.StatusCode <= 599 { + if localVarHTTPResponse.StatusCode == 500 { var v SmsApiException err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -518,15 +512,7 @@ func (a *SendSmsApiService) PreviewSmsMessageExecute(r ApiPreviewSmsMessageReque return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - var v SmsPreviewResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -594,9 +580,12 @@ func (a *SendSmsApiService) SendBinarySmsMessageExecute(r ApiSendBinarySmsMessag localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.smsAdvancedBinaryRequest == nil { + return localVarReturnValue, nil, reportError("smsAdvancedBinaryRequest is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -605,7 +594,7 @@ func (a *SendSmsApiService) SendBinarySmsMessageExecute(r ApiSendBinarySmsMessag } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -636,7 +625,7 @@ func (a *SendSmsApiService) SendBinarySmsMessageExecute(r ApiSendBinarySmsMessag body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode >= 400 && localVarHTTPResponse.StatusCode <= 499 { + if localVarHTTPResponse.StatusCode == 400 { var v SmsApiException err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -646,7 +635,7 @@ func (a *SendSmsApiService) SendBinarySmsMessageExecute(r ApiSendBinarySmsMessag newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode >= 500 && localVarHTTPResponse.StatusCode <= 599 { + if localVarHTTPResponse.StatusCode == 500 { var v SmsApiException err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -654,15 +643,7 @@ func (a *SendSmsApiService) SendBinarySmsMessageExecute(r ApiSendBinarySmsMessag return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - var v SmsResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -730,9 +711,12 @@ func (a *SendSmsApiService) SendSmsMessageExecute(r ApiSendSmsMessageRequest) (S localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.smsAdvancedTextualRequest == nil { + return localVarReturnValue, nil, reportError("smsAdvancedTextualRequest is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -741,7 +725,7 @@ func (a *SendSmsApiService) SendSmsMessageExecute(r ApiSendSmsMessageRequest) (S } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -772,7 +756,7 @@ func (a *SendSmsApiService) SendSmsMessageExecute(r ApiSendSmsMessageRequest) (S body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode >= 400 && localVarHTTPResponse.StatusCode <= 499 { + if localVarHTTPResponse.StatusCode == 400 { var v SmsApiException err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -782,7 +766,7 @@ func (a *SendSmsApiService) SendSmsMessageExecute(r ApiSendSmsMessageRequest) (S newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode >= 500 && localVarHTTPResponse.StatusCode <= 599 { + if localVarHTTPResponse.StatusCode == 500 { var v SmsApiException err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -790,15 +774,7 @@ func (a *SendSmsApiService) SendSmsMessageExecute(r ApiSendSmsMessageRequest) (S return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr } - var v SmsResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } diff --git a/v2/api_tfa.go b/v2/api_tfa.go index 422d348..c002f4d 100644 --- a/v2/api_tfa.go +++ b/v2/api_tfa.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -80,9 +79,12 @@ func (a *TfaApiService) CreateTfaApplicationExecute(r ApiCreateTfaApplicationReq localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.tfaApplicationRequest == nil { + return localVarReturnValue, nil, reportError("tfaApplicationRequest is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -91,7 +93,7 @@ func (a *TfaApiService) CreateTfaApplicationExecute(r ApiCreateTfaApplicationReq } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -220,9 +222,12 @@ func (a *TfaApiService) CreateTfaMessageTemplateExecute(r ApiCreateTfaMessageTem localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.tfaCreateMessageRequest == nil { + return localVarReturnValue, nil, reportError("tfaCreateMessageRequest is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -231,7 +236,7 @@ func (a *TfaApiService) CreateTfaMessageTemplateExecute(r ApiCreateTfaMessageTem } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -318,7 +323,7 @@ func (r ApiGetTfaApplicationRequest) Execute() (TfaApplicationResponse, *_nethtt * GetTfaApplication Get 2FA application * Get a single 2FA application to see its configuration details. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId Requested application ID. + * @param appId ID of application for which configuration view was requested. * @return ApiGetTfaApplicationRequest */ func (a *TfaApiService) GetTfaApplication(ctx _context.Context, appId string) ApiGetTfaApplicationRequest { @@ -365,7 +370,7 @@ func (a *TfaApiService) GetTfaApplicationExecute(r ApiGetTfaApplicationRequest) } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -493,7 +498,7 @@ func (a *TfaApiService) GetTfaApplicationsExecute(r ApiGetTfaApplicationsRequest } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -629,7 +634,7 @@ func (a *TfaApiService) GetTfaMessageTemplateExecute(r ApiGetTfaMessageTemplateR } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -761,7 +766,7 @@ func (a *TfaApiService) GetTfaMessageTemplatesExecute(r ApiGetTfaMessageTemplate } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -919,7 +924,7 @@ func (a *TfaApiService) GetTfaVerificationStatusExecute(r ApiGetTfaVerificationS } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -1046,9 +1051,12 @@ func (a *TfaApiService) ResendTfaPinCodeOverSmsExecute(r ApiResendTfaPinCodeOver localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.tfaResendPinRequest == nil { + return localVarReturnValue, nil, reportError("tfaResendPinRequest is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -1057,7 +1065,7 @@ func (a *TfaApiService) ResendTfaPinCodeOverSmsExecute(r ApiResendTfaPinCodeOver } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -1186,9 +1194,12 @@ func (a *TfaApiService) ResendTfaPinCodeOverVoiceExecute(r ApiResendTfaPinCodeOv localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.tfaResendPinRequest == nil { + return localVarReturnValue, nil, reportError("tfaResendPinRequest is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -1197,7 +1208,7 @@ func (a *TfaApiService) ResendTfaPinCodeOverVoiceExecute(r ApiResendTfaPinCodeOv } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -1273,18 +1284,18 @@ func (a *TfaApiService) ResendTfaPinCodeOverVoiceExecute(r ApiResendTfaPinCodeOv type ApiSendTfaPinCodeOverSmsRequest struct { ctx _context.Context ApiService *TfaApiService - ncNeeded *bool tfaStartAuthenticationRequest *TfaStartAuthenticationRequest + ncNeeded *bool } -func (r ApiSendTfaPinCodeOverSmsRequest) NcNeeded(ncNeeded bool) ApiSendTfaPinCodeOverSmsRequest { - r.ncNeeded = &ncNeeded - return r -} func (r ApiSendTfaPinCodeOverSmsRequest) TfaStartAuthenticationRequest(tfaStartAuthenticationRequest TfaStartAuthenticationRequest) ApiSendTfaPinCodeOverSmsRequest { r.tfaStartAuthenticationRequest = &tfaStartAuthenticationRequest return r } +func (r ApiSendTfaPinCodeOverSmsRequest) NcNeeded(ncNeeded bool) ApiSendTfaPinCodeOverSmsRequest { + r.ncNeeded = &ncNeeded + return r +} func (r ApiSendTfaPinCodeOverSmsRequest) Execute() (TfaStartAuthenticationResponse, *_nethttp.Response, error) { return r.ApiService.SendTfaPinCodeOverSmsExecute(r) @@ -1327,12 +1338,15 @@ func (a *TfaApiService) SendTfaPinCodeOverSmsExecute(r ApiSendTfaPinCodeOverSmsR localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.tfaStartAuthenticationRequest == nil { + return localVarReturnValue, nil, reportError("tfaStartAuthenticationRequest is required and must be specified") + } if r.ncNeeded != nil { localVarQueryParams.Add("ncNeeded", parameterToString(*r.ncNeeded, "")) } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -1341,7 +1355,7 @@ func (a *TfaApiService) SendTfaPinCodeOverSmsExecute(r ApiSendTfaPinCodeOverSmsR } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -1466,9 +1480,12 @@ func (a *TfaApiService) SendTfaPinCodeOverVoiceExecute(r ApiSendTfaPinCodeOverVo localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.tfaStartAuthenticationRequest == nil { + return localVarReturnValue, nil, reportError("tfaStartAuthenticationRequest is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -1477,7 +1494,7 @@ func (a *TfaApiService) SendTfaPinCodeOverVoiceExecute(r ApiSendTfaPinCodeOverVo } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -1606,9 +1623,12 @@ func (a *TfaApiService) UpdateTfaApplicationExecute(r ApiUpdateTfaApplicationReq localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.tfaApplicationRequest == nil { + return localVarReturnValue, nil, reportError("tfaApplicationRequest is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -1617,7 +1637,7 @@ func (a *TfaApiService) UpdateTfaApplicationExecute(r ApiUpdateTfaApplicationReq } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -1750,9 +1770,12 @@ func (a *TfaApiService) UpdateTfaMessageTemplateExecute(r ApiUpdateTfaMessageTem localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.tfaUpdateMessageRequest == nil { + return localVarReturnValue, nil, reportError("tfaUpdateMessageRequest is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -1761,7 +1784,7 @@ func (a *TfaApiService) UpdateTfaMessageTemplateExecute(r ApiUpdateTfaMessageTem } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -1890,9 +1913,12 @@ func (a *TfaApiService) VerifyTfaPhoneNumberExecute(r ApiVerifyTfaPhoneNumberReq localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.tfaVerifyPinRequest == nil { + return localVarReturnValue, nil, reportError("tfaVerifyPinRequest is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -1901,7 +1927,7 @@ func (a *TfaApiService) VerifyTfaPhoneNumberExecute(r ApiVerifyTfaPhoneNumberReq } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) diff --git a/v2/client.go b/v2/client.go index 0c0378c..d3fec43 100644 --- a/v2/client.go +++ b/v2/client.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -39,7 +38,7 @@ var ( xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) ) -// APIClient manages communication with the Infobip Client API Libraries OpenAPI Specification API v1.0.157 +// APIClient manages communication with the Infobip Client API Libraries OpenAPI Specification API v1.0.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *Configuration @@ -47,6 +46,8 @@ type APIClient struct { // API Services + ConversionApi *ConversionApiService + ReceiveSmsApi *ReceiveSmsApiService ScheduledSmsApi *ScheduledSmsApiService @@ -72,6 +73,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.common.client = c // API Services + c.ConversionApi = (*ConversionApiService)(&c.common) c.ReceiveSmsApi = (*ReceiveSmsApiService)(&c.common) c.ScheduledSmsApi = (*ScheduledSmsApiService)(&c.common) c.SendSmsApi = (*SendSmsApiService)(&c.common) diff --git a/v2/configuration.go b/v2/configuration.go index f464304..c969cdc 100644 --- a/v2/configuration.go +++ b/v2/configuration.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -92,7 +91,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "infobip-api-client-go/2.0.0", + UserAgent: "infobip-api-client-go/2.1.0", Debug: false, Servers: ServerConfigurations{ { diff --git a/v2/infobip.go b/v2/infobip.go index 469c07f..571f7b8 100644 --- a/v2/infobip.go +++ b/v2/infobip.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -11,4 +10,4 @@ package infobip -const Version = "2.0.0" +const Version = "2.1.0" diff --git a/v2/model_conversion_response.go b/v2/model_conversion_response.go new file mode 100644 index 0000000..1d8cd28 --- /dev/null +++ b/v2/model_conversion_response.go @@ -0,0 +1,114 @@ +/* + * Infobip Client API Libraries OpenAPI Specification + * + * OpenAPI specification containing public endpoints supported in client API libraries. + * + * Contact: support@infobip.com + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package infobip + +import ( + "encoding/json" +) + +// ConversionResponse struct for ConversionResponse +type ConversionResponse struct { + // Process key assigned to account ID. + ProcessKey *string `json:"processKey,omitempty"` +} + +// NewConversionResponse instantiates a new ConversionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConversionResponse() *ConversionResponse { + this := ConversionResponse{} + return &this +} + +// NewConversionResponseWithDefaults instantiates a new ConversionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConversionResponseWithDefaults() *ConversionResponse { + this := ConversionResponse{} + return &this +} + +// GetProcessKey returns the ProcessKey field value if set, zero value otherwise. +func (o *ConversionResponse) GetProcessKey() string { + if o == nil || o.ProcessKey == nil { + var ret string + return ret + } + return *o.ProcessKey +} + +// GetProcessKeyOk returns a tuple with the ProcessKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConversionResponse) GetProcessKeyOk() (*string, bool) { + if o == nil || o.ProcessKey == nil { + return nil, false + } + return o.ProcessKey, true +} + +// HasProcessKey returns a boolean if a field has been set. +func (o *ConversionResponse) HasProcessKey() bool { + if o != nil && o.ProcessKey != nil { + return true + } + + return false +} + +// SetProcessKey gets a reference to the given string and assigns it to the ProcessKey field. +func (o *ConversionResponse) SetProcessKey(v string) { + o.ProcessKey = &v +} + +func (o ConversionResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ProcessKey != nil { + toSerialize["processKey"] = o.ProcessKey + } + return json.Marshal(toSerialize) +} + +type NullableConversionResponse struct { + value *ConversionResponse + isSet bool +} + +func (v NullableConversionResponse) Get() *ConversionResponse { + return v.value +} + +func (v *NullableConversionResponse) Set(val *ConversionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableConversionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableConversionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConversionResponse(val *ConversionResponse) *NullableConversionResponse { + return &NullableConversionResponse{value: val, isSet: true} +} + +func (v NullableConversionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConversionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v2/model_sms_advanced_binary_request.go b/v2/model_sms_advanced_binary_request.go index 814a92f..fcd6090 100644 --- a/v2/model_sms_advanced_binary_request.go +++ b/v2/model_sms_advanced_binary_request.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,10 +16,10 @@ import ( // SmsAdvancedBinaryRequest struct for SmsAdvancedBinaryRequest type SmsAdvancedBinaryRequest struct { - // The ID which uniquely identifies the request. Bulk ID will be received only when you send a message to more than one destination address. - BulkId *string `json:"bulkId,omitempty"` - Messages []SmsBinaryMessage `json:"messages"` - // Limit the sending speed for message bulks. In some use cases, you might want to reduce message sending speed if your message call to action involves visiting a website, calling your contact center or similar recipient activity, in which you can handle a limited amount of load. This setting helps you to spread the delivery of the messages over a longer period, allowing your systems or agents to handle incoming traffic in real-time, resulting in better customer satisfaction. + // Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. If not provided, it will be auto-generated and returned in the API response. Typically, used to fetch [delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports) and [message logs](#channels/sms/get-outbound-sms-message-logs). + BulkId *string `json:"bulkId,omitempty"` + // An array of message objects of a single message or multiple messages sent under one bulk ID. + Messages []SmsBinaryMessage `json:"messages"` SendingSpeedLimit *SmsSendingSpeedLimit `json:"sendingSpeedLimit,omitempty"` } diff --git a/v2/model_sms_advanced_textual_request.go b/v2/model_sms_advanced_textual_request.go index fba1f73..b9d688d 100644 --- a/v2/model_sms_advanced_textual_request.go +++ b/v2/model_sms_advanced_textual_request.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,12 +16,15 @@ import ( // SmsAdvancedTextualRequest struct for SmsAdvancedTextualRequest type SmsAdvancedTextualRequest struct { - // The ID which uniquely identifies the request. Bulk ID will be received only when you send a message to more than one destination address. - BulkId *string `json:"bulkId,omitempty"` - Messages *[]SmsTextualMessage `json:"messages,omitempty"` - // Limit the sending speed for message bulks. In some use cases, you might want to reduce message sending speed if your message call to action involves visiting a website, calling your contact center or similar recipient activity, in which you can handle a limited amount of load. This setting helps you to spread the delivery of the messages over a longer period, allowing your systems or agents to handle incoming traffic in real-time, resulting in better customer satisfaction. + // Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. If not provided, it will be auto-generated and returned in the API response. Typically, used to fetch [delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports) and [message logs](#channels/sms/get-outbound-sms-message-logs). + BulkId *string `json:"bulkId,omitempty"` + // An array of message objects of a single message or multiple messages sent under one bulk ID. + Messages *[]SmsTextualMessage `json:"messages"` SendingSpeedLimit *SmsSendingSpeedLimit `json:"sendingSpeedLimit,omitempty"` + UrlOptions *SmsUrlOptions `json:"urlOptions,omitempty"` Tracking *SmsTracking `json:"tracking,omitempty"` + // Set to true to return smsCount in the response. Default is false. smsCount is the total count of SMS submitted in the request. SMS messages have a character limit and messages longer than that limit will be split into multiple SMS and reflected in the total count of SMS submitted. + IncludeSmsCountInResponse *bool `json:"includeSmsCountInResponse,omitempty"` } // NewSmsAdvancedTextualRequest instantiates a new SmsAdvancedTextualRequest object @@ -31,6 +33,8 @@ type SmsAdvancedTextualRequest struct { // will change when the set of required properties is changed func NewSmsAdvancedTextualRequest() *SmsAdvancedTextualRequest { this := SmsAdvancedTextualRequest{} + var includeSmsCountInResponse bool = false + this.IncludeSmsCountInResponse = &includeSmsCountInResponse return &this } @@ -39,6 +43,8 @@ func NewSmsAdvancedTextualRequest() *SmsAdvancedTextualRequest { // but it doesn't guarantee that properties required by API are set func NewSmsAdvancedTextualRequestWithDefaults() *SmsAdvancedTextualRequest { this := SmsAdvancedTextualRequest{} + var includeSmsCountInResponse bool = false + this.IncludeSmsCountInResponse = &includeSmsCountInResponse return &this } @@ -101,7 +107,7 @@ func (o *SmsAdvancedTextualRequest) HasMessages() bool { return false } -// SetMessages gets a reference to the given []SmsTextualMessage and assigns it to the Messages field. +// SetMessages sets field value func (o *SmsAdvancedTextualRequest) SetMessages(v []SmsTextualMessage) { o.Messages = &v } @@ -138,6 +144,38 @@ func (o *SmsAdvancedTextualRequest) SetSendingSpeedLimit(v SmsSendingSpeedLimit) o.SendingSpeedLimit = &v } +// GetUrlOptions returns the UrlOptions field value if set, zero value otherwise. +func (o *SmsAdvancedTextualRequest) GetUrlOptions() SmsUrlOptions { + if o == nil || o.UrlOptions == nil { + var ret SmsUrlOptions + return ret + } + return *o.UrlOptions +} + +// GetUrlOptionsOk returns a tuple with the UrlOptions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmsAdvancedTextualRequest) GetUrlOptionsOk() (*SmsUrlOptions, bool) { + if o == nil || o.UrlOptions == nil { + return nil, false + } + return o.UrlOptions, true +} + +// HasUrlOptions returns a boolean if a field has been set. +func (o *SmsAdvancedTextualRequest) HasUrlOptions() bool { + if o != nil && o.UrlOptions != nil { + return true + } + + return false +} + +// SetUrlOptions gets a reference to the given SmsUrlOptions and assigns it to the UrlOptions field. +func (o *SmsAdvancedTextualRequest) SetUrlOptions(v SmsUrlOptions) { + o.UrlOptions = &v +} + // GetTracking returns the Tracking field value if set, zero value otherwise. func (o *SmsAdvancedTextualRequest) GetTracking() SmsTracking { if o == nil || o.Tracking == nil { @@ -170,6 +208,38 @@ func (o *SmsAdvancedTextualRequest) SetTracking(v SmsTracking) { o.Tracking = &v } +// GetIncludeSmsCountInResponse returns the IncludeSmsCountInResponse field value if set, zero value otherwise. +func (o *SmsAdvancedTextualRequest) GetIncludeSmsCountInResponse() bool { + if o == nil || o.IncludeSmsCountInResponse == nil { + var ret bool + return ret + } + return *o.IncludeSmsCountInResponse +} + +// GetIncludeSmsCountInResponseOk returns a tuple with the IncludeSmsCountInResponse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmsAdvancedTextualRequest) GetIncludeSmsCountInResponseOk() (*bool, bool) { + if o == nil || o.IncludeSmsCountInResponse == nil { + return nil, false + } + return o.IncludeSmsCountInResponse, true +} + +// HasIncludeSmsCountInResponse returns a boolean if a field has been set. +func (o *SmsAdvancedTextualRequest) HasIncludeSmsCountInResponse() bool { + if o != nil && o.IncludeSmsCountInResponse != nil { + return true + } + + return false +} + +// SetIncludeSmsCountInResponse gets a reference to the given bool and assigns it to the IncludeSmsCountInResponse field. +func (o *SmsAdvancedTextualRequest) SetIncludeSmsCountInResponse(v bool) { + o.IncludeSmsCountInResponse = &v +} + func (o SmsAdvancedTextualRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.BulkId != nil { @@ -181,9 +251,15 @@ func (o SmsAdvancedTextualRequest) MarshalJSON() ([]byte, error) { if o.SendingSpeedLimit != nil { toSerialize["sendingSpeedLimit"] = o.SendingSpeedLimit } + if o.UrlOptions != nil { + toSerialize["urlOptions"] = o.UrlOptions + } if o.Tracking != nil { toSerialize["tracking"] = o.Tracking } + if o.IncludeSmsCountInResponse != nil { + toSerialize["includeSmsCountInResponse"] = o.IncludeSmsCountInResponse + } return json.Marshal(toSerialize) } diff --git a/v2/model_sms_api_exception.go b/v2/model_sms_api_exception.go index 8366d77..452240b 100644 --- a/v2/model_sms_api_exception.go +++ b/v2/model_sms_api_exception.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ diff --git a/v2/model_sms_api_request_error.go b/v2/model_sms_api_request_error.go index 435605c..de8f534 100644 --- a/v2/model_sms_api_request_error.go +++ b/v2/model_sms_api_request_error.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ diff --git a/v2/model_sms_api_request_error_details.go b/v2/model_sms_api_request_error_details.go index b03ea37..b699862 100644 --- a/v2/model_sms_api_request_error_details.go +++ b/v2/model_sms_api_request_error_details.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -21,6 +20,8 @@ type SmsApiRequestErrorDetails struct { MessageId *string `json:"messageId,omitempty"` // Detailed error description. Text *string `json:"text,omitempty"` + // Validation errors. + ValidationErrors *map[string][]string `json:"validationErrors,omitempty"` } // NewSmsApiRequestErrorDetails instantiates a new SmsApiRequestErrorDetails object @@ -104,6 +105,38 @@ func (o *SmsApiRequestErrorDetails) SetText(v string) { o.Text = &v } +// GetValidationErrors returns the ValidationErrors field value if set, zero value otherwise. +func (o *SmsApiRequestErrorDetails) GetValidationErrors() map[string][]string { + if o == nil || o.ValidationErrors == nil { + var ret map[string][]string + return ret + } + return *o.ValidationErrors +} + +// GetValidationErrorsOk returns a tuple with the ValidationErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmsApiRequestErrorDetails) GetValidationErrorsOk() (*map[string][]string, bool) { + if o == nil || o.ValidationErrors == nil { + return nil, false + } + return o.ValidationErrors, true +} + +// HasValidationErrors returns a boolean if a field has been set. +func (o *SmsApiRequestErrorDetails) HasValidationErrors() bool { + if o != nil && o.ValidationErrors != nil { + return true + } + + return false +} + +// SetValidationErrors gets a reference to the given map[string][]string and assigns it to the ValidationErrors field. +func (o *SmsApiRequestErrorDetails) SetValidationErrors(v map[string][]string) { + o.ValidationErrors = &v +} + func (o SmsApiRequestErrorDetails) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.MessageId != nil { @@ -112,6 +145,9 @@ func (o SmsApiRequestErrorDetails) MarshalJSON() ([]byte, error) { if o.Text != nil { toSerialize["text"] = o.Text } + if o.ValidationErrors != nil { + toSerialize["validationErrors"] = o.ValidationErrors + } return json.Marshal(toSerialize) } diff --git a/v2/model_sms_binary_content.go b/v2/model_sms_binary_content.go index 95bc71b..90bfcec 100644 --- a/v2/model_sms_binary_content.go +++ b/v2/model_sms_binary_content.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ diff --git a/v2/model_sms_binary_message.go b/v2/model_sms_binary_message.go index a25001d..ab7c4de 100644 --- a/v2/model_sms_binary_message.go +++ b/v2/model_sms_binary_message.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -15,30 +14,33 @@ import ( "encoding/json" ) -// SmsBinaryMessage struct for SmsBinaryMessage +// SmsBinaryMessage An array of message objects of a single message or multiple messages sent under one bulk ID. type SmsBinaryMessage struct { Binary *SmsBinaryContent `json:"binary,omitempty"` - // Additional client's data that will be sent on the notifyUrl. The maximum value is 200 characters. - CallbackData *string `json:"callbackData,omitempty"` - // Scheduling object that allows setting up detailed time windows in which the message can be sent. Consists of `from`, `to` and `days` properties. `Days` property is mandatory. `From` and `to` properties should be either both included, to allow finer time window granulation or both omitted, to include whole days in the delivery time window. + // Additional client data that will be sent on the notifyUrl. The maximum value is 4000 characters. + CallbackData *string `json:"callbackData,omitempty"` DeliveryTimeWindow *SmsDeliveryTimeWindow `json:"deliveryTimeWindow,omitempty"` - Destinations *[]SmsDestination `json:"destinations,omitempty"` - // Can be `true` or `false`. If the value is set to `true`, a flash SMS will be sent. Otherwise, a normal SMS will be sent. The default value is `false`. + // An array of destination objects for where messages are being sent. A valid destination is required. + Destinations *[]SmsDestination `json:"destinations"` + // Allows for sending a [flash SMS](https://www.infobip.com/docs/sms/message-types#flash-sms) to automatically appear on recipient devices without interaction. Set to `true` to enable flash SMS, or leave the default value, `false` to send a standard SMS. Flash *bool `json:"flash,omitempty"` - // Represents a sender ID which can be alphanumeric or numeric. Alphanumeric sender ID length should be between 3 and 11 characters (Example: `CompanyName`). Numeric sender ID length should be between 3 and 14 characters. + // The sender ID which can be alphanumeric or numeric (e.g., `CompanyName`). Make sure you don't exceed [character limit](https://www.infobip.com/docs/sms/get-started#sender-names). From *string `json:"from,omitempty"` - // The real-time Intermediate delivery report that will be sent on your callback server. Can be `true` or `false`. + // The [real-time intermediate delivery report](https://www.infobip.com/docs/api#channels/sms/receive-outbound-sms-message-report) containing GSM error codes, messages status, pricing, network and country codes, etc., which will be sent on your callback server. Defaults to `false`. IntermediateReport *bool `json:"intermediateReport,omitempty"` - // Preferred Delivery report content type. Can be `application/json` or `application/xml`. + // Preferred delivery report content type, `application/json` or `application/xml`. NotifyContentType *string `json:"notifyContentType,omitempty"` // The URL on your call back server on which the Delivery report will be sent. - NotifyUrl *string `json:"notifyUrl,omitempty"` - // Region specific parameters, often specified by local laws. Use this if country or region that you are sending SMS to requires some extra parameters. - Regional *SmsRegionalOptions `json:"regional,omitempty"` - // Date and time when the message is to be sent. Used for scheduled SMS (SMS not sent immediately, but at the scheduled time). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. + NotifyUrl *string `json:"notifyUrl,omitempty"` + Regional *SmsRegionalOptions `json:"regional,omitempty"` + // Date and time when the message is to be sent. Used for [scheduled SMS](https://www.infobip.com/docs/api#channels/sms/get-scheduled-sms-messages). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`, and can only be scheduled for no later than 180 days in advance. SendAt *Time `json:"sendAt,omitempty"` // The message validity period in minutes. When the period expires, it will not be allowed for the message to be sent. Validity period longer than 48h is not supported (in this case, it will be automatically set to 48h). ValidityPeriod *int64 `json:"validityPeriod,omitempty"` + // Required for entity use in a send request for outbound traffic. Returned in notification events. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). + EntityId *string `json:"entityId,omitempty"` + // Required for application use in a send request for outbound traffic. Returned in notification events. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). + ApplicationId *string `json:"applicationId,omitempty"` } // NewSmsBinaryMessage instantiates a new SmsBinaryMessage object @@ -160,6 +162,7 @@ func (o *SmsBinaryMessage) GetDestinations() []SmsDestination { var ret []SmsDestination return ret } + return *o.Destinations } @@ -442,6 +445,70 @@ func (o *SmsBinaryMessage) SetValidityPeriod(v int64) { o.ValidityPeriod = &v } +// GetEntityId returns the EntityId field value if set, zero value otherwise. +func (o *SmsBinaryMessage) GetEntityId() string { + if o == nil || o.EntityId == nil { + var ret string + return ret + } + return *o.EntityId +} + +// GetEntityIdOk returns a tuple with the EntityId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmsBinaryMessage) GetEntityIdOk() (*string, bool) { + if o == nil || o.EntityId == nil { + return nil, false + } + return o.EntityId, true +} + +// HasEntityId returns a boolean if a field has been set. +func (o *SmsBinaryMessage) HasEntityId() bool { + if o != nil && o.EntityId != nil { + return true + } + + return false +} + +// SetEntityId gets a reference to the given string and assigns it to the EntityId field. +func (o *SmsBinaryMessage) SetEntityId(v string) { + o.EntityId = &v +} + +// GetApplicationId returns the ApplicationId field value if set, zero value otherwise. +func (o *SmsBinaryMessage) GetApplicationId() string { + if o == nil || o.ApplicationId == nil { + var ret string + return ret + } + return *o.ApplicationId +} + +// GetApplicationIdOk returns a tuple with the ApplicationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmsBinaryMessage) GetApplicationIdOk() (*string, bool) { + if o == nil || o.ApplicationId == nil { + return nil, false + } + return o.ApplicationId, true +} + +// HasApplicationId returns a boolean if a field has been set. +func (o *SmsBinaryMessage) HasApplicationId() bool { + if o != nil && o.ApplicationId != nil { + return true + } + + return false +} + +// SetApplicationId gets a reference to the given string and assigns it to the ApplicationId field. +func (o *SmsBinaryMessage) SetApplicationId(v string) { + o.ApplicationId = &v +} + func (o SmsBinaryMessage) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Binary != nil { @@ -480,6 +547,12 @@ func (o SmsBinaryMessage) MarshalJSON() ([]byte, error) { if o.ValidityPeriod != nil { toSerialize["validityPeriod"] = o.ValidityPeriod } + if o.EntityId != nil { + toSerialize["entityId"] = o.EntityId + } + if o.ApplicationId != nil { + toSerialize["applicationId"] = o.ApplicationId + } return json.Marshal(toSerialize) } diff --git a/v2/model_sms_bulk_request.go b/v2/model_sms_bulk_request.go index df4ad7e..a9e7d31 100644 --- a/v2/model_sms_bulk_request.go +++ b/v2/model_sms_bulk_request.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,6 +16,7 @@ import ( // SmsBulkRequest struct for SmsBulkRequest type SmsBulkRequest struct { + // Date and time when the message is to be sent. Used for scheduled SMS (see [Scheduled SMS endpoints](#channels/sms/get-scheduled-sms-messages) for more details). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`, and can only be scheduled for no later than 180 days in advance. SendAt Time `json:"sendAt"` } diff --git a/v2/model_sms_bulk_response.go b/v2/model_sms_bulk_response.go index 262a00c..5ab979f 100644 --- a/v2/model_sms_bulk_response.go +++ b/v2/model_sms_bulk_response.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,8 +16,10 @@ import ( // SmsBulkResponse struct for SmsBulkResponse type SmsBulkResponse struct { + // Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. BulkId *string `json:"bulkId,omitempty"` - SendAt *Time `json:"sendAt,omitempty"` + // Date and time when the message is to be sent. Used for scheduled SMS (see [Scheduled SMS endpoints](#channels/sms/get-scheduled-sms-messages) for more details). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`, and can only be scheduled for no later than 180 days in advance. + SendAt *Time `json:"sendAt,omitempty"` } // NewSmsBulkResponse instantiates a new SmsBulkResponse object diff --git a/v2/model_sms_bulk_status.go b/v2/model_sms_bulk_status.go index a09566b..838db8f 100644 --- a/v2/model_sms_bulk_status.go +++ b/v2/model_sms_bulk_status.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -16,7 +15,7 @@ import ( "fmt" ) -// SmsBulkStatus the model 'SmsBulkStatus' +// SmsBulkStatus The status of the message(s). type SmsBulkStatus string // List of SmsBulkStatus diff --git a/v2/model_sms_bulk_status_response.go b/v2/model_sms_bulk_status_response.go index 52209b4..a338558 100644 --- a/v2/model_sms_bulk_status_response.go +++ b/v2/model_sms_bulk_status_response.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,6 +16,7 @@ import ( // SmsBulkStatusResponse struct for SmsBulkStatusResponse type SmsBulkStatusResponse struct { + // Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. BulkId *string `json:"bulkId,omitempty"` Status *SmsBulkStatus `json:"status,omitempty"` } diff --git a/v2/model_sms_delivery_day.go b/v2/model_sms_delivery_day.go index dcd24ae..c13730f 100644 --- a/v2/model_sms_delivery_day.go +++ b/v2/model_sms_delivery_day.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -16,7 +15,7 @@ import ( "fmt" ) -// SmsDeliveryDay the model 'SmsDeliveryDay' +// SmsDeliveryDay Days of the week which are included in the delivery time window. At least one day must be provided. Separate multiple days with a comma. type SmsDeliveryDay string // List of SmsDeliveryDay diff --git a/v2/model_sms_delivery_result.go b/v2/model_sms_delivery_result.go index 29312e3..af2fc54 100644 --- a/v2/model_sms_delivery_result.go +++ b/v2/model_sms_delivery_result.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ diff --git a/v2/model_sms_delivery_time.go b/v2/model_sms_delivery_time.go index 474f7ad..6ef1f07 100644 --- a/v2/model_sms_delivery_time.go +++ b/v2/model_sms_delivery_time.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -15,11 +14,11 @@ import ( "encoding/json" ) -// SmsDeliveryTime struct for SmsDeliveryTime +// SmsDeliveryTime The exact time of day to end sending messages. Time is expressed in the UTC time zone. If set, use it together with the `from` property with minimum 1 hour difference. type SmsDeliveryTime struct { - // Hour when the time window opens when used in from property or closes when used into the property. + // Hour when the time window opens when used in the `from` property or closes when used in the `to` property. Hour int32 `json:"hour"` - // Minute when the time window opens when used in from property or closes when used into the property. + // Minute when the time window opens when used in the `from` property or closes when used in the `to` property. Minute int32 `json:"minute"` } diff --git a/v2/model_sms_delivery_time_window.go b/v2/model_sms_delivery_time_window.go index 6a00f01..0765617 100644 --- a/v2/model_sms_delivery_time_window.go +++ b/v2/model_sms_delivery_time_window.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -15,14 +14,12 @@ import ( "encoding/json" ) -// SmsDeliveryTimeWindow struct for SmsDeliveryTimeWindow +// SmsDeliveryTimeWindow Sets specific SMS delivery window outside of which messages won't be delivered. Often, used when there are restrictions on when messages can be sent. type SmsDeliveryTimeWindow struct { - // Days which are included in the delivery time window. Values are: `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`, `SATURDAY`, `SUNDAY`. At least one day must be stated. + // Days of the week which are included in the delivery time window. At least one day must be provided. Separate multiple days with a comma. Days []SmsDeliveryDay `json:"days"` - // Exact time of day in which the sending can start. Consists of hour and minute properties, both mandatory. Time is expressed in the UTC time zone. From *SmsDeliveryTime `json:"from,omitempty"` - // Exact time of day in which the sending will end. Consists of an hour and minute properties, both mandatory. Time is expressed in the UTC time zone. - To *SmsDeliveryTime `json:"to,omitempty"` + To *SmsDeliveryTime `json:"to,omitempty"` } // NewSmsDeliveryTimeWindow instantiates a new SmsDeliveryTimeWindow object diff --git a/v2/model_sms_destination.go b/v2/model_sms_destination.go index f61df70..941973e 100644 --- a/v2/model_sms_destination.go +++ b/v2/model_sms_destination.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -15,7 +14,7 @@ import ( "encoding/json" ) -// SmsDestination struct for SmsDestination +// SmsDestination An array of destination objects for where messages are being sent. A valid destination is required. type SmsDestination struct { // The ID that uniquely identifies the message sent. MessageId *string `json:"messageId,omitempty"` diff --git a/v2/model_sms_error.go b/v2/model_sms_error.go index a6cf8fd..b467897 100644 --- a/v2/model_sms_error.go +++ b/v2/model_sms_error.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -15,10 +14,8 @@ import ( "encoding/json" ) -// SmsError struct for SmsError +// SmsError Indicates whether an error occurred during the query execution. type SmsError struct { - // Human-readable description of the error.. - Description *string `json:"description,omitempty"` // Error group ID. GroupId *int32 `json:"groupId,omitempty"` // Error group name. @@ -27,6 +24,8 @@ type SmsError struct { Id *int32 `json:"id,omitempty"` // Error name. Name *string `json:"name,omitempty"` + // Human-readable description of the error.. + Description *string `json:"description,omitempty"` // Tells if the error is permanent. Permanent *bool `json:"permanent,omitempty"` } @@ -48,38 +47,6 @@ func NewSmsErrorWithDefaults() *SmsError { return &this } -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *SmsError) GetDescription() string { - if o == nil || o.Description == nil { - var ret string - return ret - } - return *o.Description -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SmsError) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *SmsError) HasDescription() bool { - if o != nil && o.Description != nil { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *SmsError) SetDescription(v string) { - o.Description = &v -} - // GetGroupId returns the GroupId field value if set, zero value otherwise. func (o *SmsError) GetGroupId() int32 { if o == nil || o.GroupId == nil { @@ -208,6 +175,38 @@ func (o *SmsError) SetName(v string) { o.Name = &v } +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SmsError) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmsError) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SmsError) HasDescription() bool { + if o != nil && o.Description != nil { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SmsError) SetDescription(v string) { + o.Description = &v +} + // GetPermanent returns the Permanent field value if set, zero value otherwise. func (o *SmsError) GetPermanent() bool { if o == nil || o.Permanent == nil { @@ -242,9 +241,6 @@ func (o *SmsError) SetPermanent(v bool) { func (o SmsError) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Description != nil { - toSerialize["description"] = o.Description - } if o.GroupId != nil { toSerialize["groupId"] = o.GroupId } @@ -257,6 +253,9 @@ func (o SmsError) MarshalJSON() ([]byte, error) { if o.Name != nil { toSerialize["name"] = o.Name } + if o.Description != nil { + toSerialize["description"] = o.Description + } if o.Permanent != nil { toSerialize["permanent"] = o.Permanent } diff --git a/v2/model_sms_inbound_message.go b/v2/model_sms_inbound_message.go index d0ae2c1..72f28f5 100644 --- a/v2/model_sms_inbound_message.go +++ b/v2/model_sms_inbound_message.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,24 +16,24 @@ import ( // SmsInboundMessage struct for SmsInboundMessage type SmsInboundMessage struct { - // Custom callback data can be inserted during the setup phase. + // Custom callback data sent over the notifyUrl. CallbackData *string `json:"callbackData,omitempty"` - // Text of received message without a keyword (if a keyword was sent). + // Content of the message without a keyword (if a keyword was sent). CleanText *string `json:"cleanText,omitempty"` // Sender ID that can be alphanumeric or numeric. From *string `json:"from,omitempty"` - // Keyword extracted from the message text. + // Keyword extracted from the message content. Keyword *string `json:"keyword,omitempty"` - // The ID that uniquely identifies the received message. + // Unique message ID. MessageId *string `json:"messageId,omitempty"` Price *SmsPrice `json:"price,omitempty"` - // Tells when Infobip platform received the message. It has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. + // Indicates when the Infobip platform received the message. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. ReceivedAt *Time `json:"receivedAt,omitempty"` - // The number of sent message segments. + // The number of characters within a message SmsCount *int32 `json:"smsCount,omitempty"` - // Full text of the received message. + // Full content of the message. Text *string `json:"text,omitempty"` - // The message destination address. + // The destination address of the message. To *string `json:"to,omitempty"` } diff --git a/v2/model_sms_inbound_message_result.go b/v2/model_sms_inbound_message_result.go index 203b867..5bd3af9 100644 --- a/v2/model_sms_inbound_message_result.go +++ b/v2/model_sms_inbound_message_result.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,9 +16,12 @@ import ( // SmsInboundMessageResult struct for SmsInboundMessageResult type SmsInboundMessageResult struct { - MessageCount *int32 `json:"messageCount,omitempty"` - PendingMessageCount *int32 `json:"pendingMessageCount,omitempty"` - Results *[]SmsInboundMessage `json:"results,omitempty"` + // The number of messages returned in the `results` array. + MessageCount *int32 `json:"messageCount,omitempty"` + // The number of messages that have not been pulled in. + PendingMessageCount *int32 `json:"pendingMessageCount,omitempty"` + // An array of result objects. + Results *[]SmsInboundMessage `json:"results,omitempty"` } // NewSmsInboundMessageResult instantiates a new SmsInboundMessageResult object diff --git a/v2/model_sms_india_dlt_options.go b/v2/model_sms_india_dlt_options.go index 66ccaa1..d48a5f1 100644 --- a/v2/model_sms_india_dlt_options.go +++ b/v2/model_sms_india_dlt_options.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -15,11 +14,11 @@ import ( "encoding/json" ) -// SmsIndiaDltOptions struct for SmsIndiaDltOptions +// SmsIndiaDltOptions Distributed Ledger Technology (DLT) specific parameters required for sending SMS to phone numbers registered in India. type SmsIndiaDltOptions struct { - // Id of your registered DTL content template that matches this message's text. + // Registered DLT content template ID which matches message you are sending. ContentTemplateId *string `json:"contentTemplateId,omitempty"` - // Your assigned DTL principal entity id. + // Your assigned DLT principal entity ID. PrincipalEntityId string `json:"principalEntityId"` } diff --git a/v2/model_sms_language.go b/v2/model_sms_language.go index c863053..0520cf1 100644 --- a/v2/model_sms_language.go +++ b/v2/model_sms_language.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,7 +16,7 @@ import ( // SmsLanguage struct for SmsLanguage type SmsLanguage struct { - // Code for language character set of a message text. Possible values: `TR` for Turkish, `ES` for Spanish, `PT` for Portuguese and `AUTODETECT` to let platform pick character set automatically based on the message text. + // Language code for the correct character set. Possible values: `TR` for Turkish, `ES` for Spanish, `PT` for Portuguese, or `AUTODETECT` to let platform select the character set based on message content. LanguageCode *string `json:"languageCode,omitempty"` } diff --git a/v2/model_sms_language_configuration.go b/v2/model_sms_language_configuration.go index 6f64f1c..15cf38d 100644 --- a/v2/model_sms_language_configuration.go +++ b/v2/model_sms_language_configuration.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -15,10 +14,10 @@ import ( "encoding/json" ) -// SmsLanguageConfiguration struct for SmsLanguageConfiguration +// SmsLanguageConfiguration Sets up additional configuration that changes the original message content you can preview with this call. type SmsLanguageConfiguration struct { Language *SmsLanguage `json:"language,omitempty"` - // Conversion of a message text from one script to another. Possible values: `TURKISH`, `GREEK`, `CYRILLIC`, `SERBIAN_CYRILLIC`, `CENTRAL_EUROPEAN`, `BALTIC` and `NON_UNICODE`. + // Conversion of a message text from one script to another. Possible values: `TURKISH`, `GREEK`, `CYRILLIC`, `SERBIAN_CYRILLIC`, `BULGARIAN_CYRILLIC`, `CENTRAL_EUROPEAN`, `BALTIC` and `NON_UNICODE`. Transliteration *string `json:"transliteration,omitempty"` } diff --git a/v2/model_sms_log.go b/v2/model_sms_log.go index c9f5693..3cd2efa 100644 --- a/v2/model_sms_log.go +++ b/v2/model_sms_log.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,26 +16,26 @@ import ( // SmsLog struct for SmsLog type SmsLog struct { - // The ID that uniquely identifies the request. + // Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. BulkId *string `json:"bulkId,omitempty"` - // Tells when the SMS was finished processing by Infobip (i.e. delivered to the destination, delivered to the destination network, etc.). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. + // Date and time when the Infobip services finished processing the message (i.e. delivered to the destination, delivered to the destination network, etc.). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. DoneAt *Time `json:"doneAt,omitempty"` Error *SmsError `json:"error,omitempty"` // Sender ID that can be alphanumeric or numeric. From *string `json:"from,omitempty"` // Mobile country and network codes. MccMnc *string `json:"mccMnc,omitempty"` - // The ID that uniquely identifies the message sent. + // Unique message ID. MessageId *string `json:"messageId,omitempty"` Price *SmsPrice `json:"price,omitempty"` - // Tells when the SMS was sent. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. + // Date and time when the message was [scheduled](https://www.infobip.com/docs/api#channels/sms/get-scheduled-sms-messages) to be sent. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. SentAt *Time `json:"sentAt,omitempty"` - // The number of sent message segments. + // The number of parts the message content was split into. SmsCount *int32 `json:"smsCount,omitempty"` Status *SmsStatus `json:"status,omitempty"` - // Text of the message that was sent. + // Content of the message being sent. Text *string `json:"text,omitempty"` - // The message destination address. + // The destination address of the message. To *string `json:"to,omitempty"` } diff --git a/v2/model_sms_logs_response.go b/v2/model_sms_logs_response.go index 21192ee..e6516ca 100644 --- a/v2/model_sms_logs_response.go +++ b/v2/model_sms_logs_response.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ diff --git a/v2/model_sms_preview.go b/v2/model_sms_preview.go index 2eaf248..41eb275 100644 --- a/v2/model_sms_preview.go +++ b/v2/model_sms_preview.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -15,16 +14,15 @@ import ( "encoding/json" ) -// SmsPreview struct for SmsPreview +// SmsPreview Allows for previewing the original message content once additional language configuration has been applied to it. type SmsPreview struct { - // Number of remaining characters in the last SMS part. - CharactersRemaining *int32 `json:"charactersRemaining,omitempty"` - // Configuration that, when sent with the original text, results in this preview. - Configuration *SmsLanguageConfiguration `json:"configuration,omitempty"` + // Preview of the message content as it should appear on the recipient’s device. + TextPreview *string `json:"textPreview,omitempty"` // Number of SMS message parts required to deliver the message. MessageCount *int32 `json:"messageCount,omitempty"` - // Preview of the text as it should appear on the recipient’s device. - TextPreview *string `json:"textPreview,omitempty"` + // Number of remaining characters in the last part of the SMS. + CharactersRemaining *int32 `json:"charactersRemaining,omitempty"` + Configuration *SmsLanguageConfiguration `json:"configuration,omitempty"` } // NewSmsPreview instantiates a new SmsPreview object @@ -44,148 +42,148 @@ func NewSmsPreviewWithDefaults() *SmsPreview { return &this } -// GetCharactersRemaining returns the CharactersRemaining field value if set, zero value otherwise. -func (o *SmsPreview) GetCharactersRemaining() int32 { - if o == nil || o.CharactersRemaining == nil { - var ret int32 +// GetTextPreview returns the TextPreview field value if set, zero value otherwise. +func (o *SmsPreview) GetTextPreview() string { + if o == nil || o.TextPreview == nil { + var ret string return ret } - return *o.CharactersRemaining + return *o.TextPreview } -// GetCharactersRemainingOk returns a tuple with the CharactersRemaining field value if set, nil otherwise +// GetTextPreviewOk returns a tuple with the TextPreview field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SmsPreview) GetCharactersRemainingOk() (*int32, bool) { - if o == nil || o.CharactersRemaining == nil { +func (o *SmsPreview) GetTextPreviewOk() (*string, bool) { + if o == nil || o.TextPreview == nil { return nil, false } - return o.CharactersRemaining, true + return o.TextPreview, true } -// HasCharactersRemaining returns a boolean if a field has been set. -func (o *SmsPreview) HasCharactersRemaining() bool { - if o != nil && o.CharactersRemaining != nil { +// HasTextPreview returns a boolean if a field has been set. +func (o *SmsPreview) HasTextPreview() bool { + if o != nil && o.TextPreview != nil { return true } return false } -// SetCharactersRemaining gets a reference to the given int32 and assigns it to the CharactersRemaining field. -func (o *SmsPreview) SetCharactersRemaining(v int32) { - o.CharactersRemaining = &v +// SetTextPreview gets a reference to the given string and assigns it to the TextPreview field. +func (o *SmsPreview) SetTextPreview(v string) { + o.TextPreview = &v } -// GetConfiguration returns the Configuration field value if set, zero value otherwise. -func (o *SmsPreview) GetConfiguration() SmsLanguageConfiguration { - if o == nil || o.Configuration == nil { - var ret SmsLanguageConfiguration +// GetMessageCount returns the MessageCount field value if set, zero value otherwise. +func (o *SmsPreview) GetMessageCount() int32 { + if o == nil || o.MessageCount == nil { + var ret int32 return ret } - return *o.Configuration + return *o.MessageCount } -// GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise +// GetMessageCountOk returns a tuple with the MessageCount field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SmsPreview) GetConfigurationOk() (*SmsLanguageConfiguration, bool) { - if o == nil || o.Configuration == nil { +func (o *SmsPreview) GetMessageCountOk() (*int32, bool) { + if o == nil || o.MessageCount == nil { return nil, false } - return o.Configuration, true + return o.MessageCount, true } -// HasConfiguration returns a boolean if a field has been set. -func (o *SmsPreview) HasConfiguration() bool { - if o != nil && o.Configuration != nil { +// HasMessageCount returns a boolean if a field has been set. +func (o *SmsPreview) HasMessageCount() bool { + if o != nil && o.MessageCount != nil { return true } return false } -// SetConfiguration gets a reference to the given SmsLanguageConfiguration and assigns it to the Configuration field. -func (o *SmsPreview) SetConfiguration(v SmsLanguageConfiguration) { - o.Configuration = &v +// SetMessageCount gets a reference to the given int32 and assigns it to the MessageCount field. +func (o *SmsPreview) SetMessageCount(v int32) { + o.MessageCount = &v } -// GetMessageCount returns the MessageCount field value if set, zero value otherwise. -func (o *SmsPreview) GetMessageCount() int32 { - if o == nil || o.MessageCount == nil { +// GetCharactersRemaining returns the CharactersRemaining field value if set, zero value otherwise. +func (o *SmsPreview) GetCharactersRemaining() int32 { + if o == nil || o.CharactersRemaining == nil { var ret int32 return ret } - return *o.MessageCount + return *o.CharactersRemaining } -// GetMessageCountOk returns a tuple with the MessageCount field value if set, nil otherwise +// GetCharactersRemainingOk returns a tuple with the CharactersRemaining field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SmsPreview) GetMessageCountOk() (*int32, bool) { - if o == nil || o.MessageCount == nil { +func (o *SmsPreview) GetCharactersRemainingOk() (*int32, bool) { + if o == nil || o.CharactersRemaining == nil { return nil, false } - return o.MessageCount, true + return o.CharactersRemaining, true } -// HasMessageCount returns a boolean if a field has been set. -func (o *SmsPreview) HasMessageCount() bool { - if o != nil && o.MessageCount != nil { +// HasCharactersRemaining returns a boolean if a field has been set. +func (o *SmsPreview) HasCharactersRemaining() bool { + if o != nil && o.CharactersRemaining != nil { return true } return false } -// SetMessageCount gets a reference to the given int32 and assigns it to the MessageCount field. -func (o *SmsPreview) SetMessageCount(v int32) { - o.MessageCount = &v +// SetCharactersRemaining gets a reference to the given int32 and assigns it to the CharactersRemaining field. +func (o *SmsPreview) SetCharactersRemaining(v int32) { + o.CharactersRemaining = &v } -// GetTextPreview returns the TextPreview field value if set, zero value otherwise. -func (o *SmsPreview) GetTextPreview() string { - if o == nil || o.TextPreview == nil { - var ret string +// GetConfiguration returns the Configuration field value if set, zero value otherwise. +func (o *SmsPreview) GetConfiguration() SmsLanguageConfiguration { + if o == nil || o.Configuration == nil { + var ret SmsLanguageConfiguration return ret } - return *o.TextPreview + return *o.Configuration } -// GetTextPreviewOk returns a tuple with the TextPreview field value if set, nil otherwise +// GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SmsPreview) GetTextPreviewOk() (*string, bool) { - if o == nil || o.TextPreview == nil { +func (o *SmsPreview) GetConfigurationOk() (*SmsLanguageConfiguration, bool) { + if o == nil || o.Configuration == nil { return nil, false } - return o.TextPreview, true + return o.Configuration, true } -// HasTextPreview returns a boolean if a field has been set. -func (o *SmsPreview) HasTextPreview() bool { - if o != nil && o.TextPreview != nil { +// HasConfiguration returns a boolean if a field has been set. +func (o *SmsPreview) HasConfiguration() bool { + if o != nil && o.Configuration != nil { return true } return false } -// SetTextPreview gets a reference to the given string and assigns it to the TextPreview field. -func (o *SmsPreview) SetTextPreview(v string) { - o.TextPreview = &v +// SetConfiguration gets a reference to the given SmsLanguageConfiguration and assigns it to the Configuration field. +func (o *SmsPreview) SetConfiguration(v SmsLanguageConfiguration) { + o.Configuration = &v } func (o SmsPreview) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} + if o.TextPreview != nil { + toSerialize["textPreview"] = o.TextPreview + } + if o.MessageCount != nil { + toSerialize["messageCount"] = o.MessageCount + } if o.CharactersRemaining != nil { toSerialize["charactersRemaining"] = o.CharactersRemaining } if o.Configuration != nil { toSerialize["configuration"] = o.Configuration } - if o.MessageCount != nil { - toSerialize["messageCount"] = o.MessageCount - } - if o.TextPreview != nil { - toSerialize["textPreview"] = o.TextPreview - } return json.Marshal(toSerialize) } diff --git a/v2/model_sms_preview_request.go b/v2/model_sms_preview_request.go index 14410b6..b1fbe59 100644 --- a/v2/model_sms_preview_request.go +++ b/v2/model_sms_preview_request.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,11 +16,11 @@ import ( // SmsPreviewRequest struct for SmsPreviewRequest type SmsPreviewRequest struct { - // Code for language character set of a message text. Possible values: `TR` for Turkish, `ES` for Spanish, `PT` for Portuguese and `AUTODETECT` to let platform pick character set automatically based on the message text. - LanguageCode *string `json:"languageCode,omitempty"` - // Message text to preview. + // Content of the message being sent. Text string `json:"text"` - // Conversion of a message text from one script to another. Possible values: `TURKISH`, `GREEK`, `CYRILLIC`, `SERBIAN_CYRILLIC`, `CENTRAL_EUROPEAN`, `BALTIC` and `NON_UNICODE`. + // Language code for the correct character set. Possible values: `TR` for Turkish, `ES` for Spanish, `PT` for Portuguese, or `AUTODETECT` to let platform select the character set based on message content. + LanguageCode *string `json:"languageCode,omitempty"` + // The transliteration of your sent message from one script to another. Transliteration is used to replace characters which are not recognized as part of your defaulted alphabet. Possible values: `TURKISH`, `GREEK`, `CYRILLIC`, `SERBIAN_CYRILLIC`, `BULGARIAN_CYRILLIC`, `CENTRAL_EUROPEAN`, `BALTIC`, `PORTUGUESE`, `COLOMBIAN`, `NON_UNICDE`, `ALL` and `NONE`. Transliteration *string `json:"transliteration,omitempty"` } @@ -43,6 +42,30 @@ func NewSmsPreviewRequestWithDefaults() *SmsPreviewRequest { return &this } +// GetText returns the Text field value +func (o *SmsPreviewRequest) GetText() string { + if o == nil { + var ret string + return ret + } + + return o.Text +} + +// GetTextOk returns a tuple with the Text field value +// and a boolean to check if the value has been set. +func (o *SmsPreviewRequest) GetTextOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Text, true +} + +// SetText sets field value +func (o *SmsPreviewRequest) SetText(v string) { + o.Text = v +} + // GetLanguageCode returns the LanguageCode field value if set, zero value otherwise. func (o *SmsPreviewRequest) GetLanguageCode() string { if o == nil || o.LanguageCode == nil { @@ -75,30 +98,6 @@ func (o *SmsPreviewRequest) SetLanguageCode(v string) { o.LanguageCode = &v } -// GetText returns the Text field value -func (o *SmsPreviewRequest) GetText() string { - if o == nil { - var ret string - return ret - } - - return o.Text -} - -// GetTextOk returns a tuple with the Text field value -// and a boolean to check if the value has been set. -func (o *SmsPreviewRequest) GetTextOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Text, true -} - -// SetText sets field value -func (o *SmsPreviewRequest) SetText(v string) { - o.Text = v -} - // GetTransliteration returns the Transliteration field value if set, zero value otherwise. func (o *SmsPreviewRequest) GetTransliteration() string { if o == nil || o.Transliteration == nil { @@ -133,12 +132,12 @@ func (o *SmsPreviewRequest) SetTransliteration(v string) { func (o SmsPreviewRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.LanguageCode != nil { - toSerialize["languageCode"] = o.LanguageCode - } if true { toSerialize["text"] = o.Text } + if o.LanguageCode != nil { + toSerialize["languageCode"] = o.LanguageCode + } if o.Transliteration != nil { toSerialize["transliteration"] = o.Transliteration } diff --git a/v2/model_sms_preview_response.go b/v2/model_sms_preview_response.go index 51526c0..ecb883c 100644 --- a/v2/model_sms_preview_response.go +++ b/v2/model_sms_preview_response.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,9 +16,9 @@ import ( // SmsPreviewResponse struct for SmsPreviewResponse type SmsPreviewResponse struct { - // Text supplied in the request. + // Message content supplied in the request. OriginalText *string `json:"originalText,omitempty"` - // Previews of applying different configurations to the original text. + // Allows for previewing the original message content once additional language configuration has been applied to it. Previews *[]SmsPreview `json:"previews,omitempty"` } diff --git a/v2/model_sms_price.go b/v2/model_sms_price.go index 8db5b23..f30573a 100644 --- a/v2/model_sms_price.go +++ b/v2/model_sms_price.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -15,12 +14,12 @@ import ( "encoding/json" ) -// SmsPrice struct for SmsPrice +// SmsPrice Sent SMS price. type SmsPrice struct { - // The currency in which the price is expressed. - Currency *string `json:"currency,omitempty"` // Price per one SMS. PricePerMessage *float64 `json:"pricePerMessage,omitempty"` + // The currency in which the price is expressed. + Currency *string `json:"currency,omitempty"` } // NewSmsPrice instantiates a new SmsPrice object @@ -40,78 +39,78 @@ func NewSmsPriceWithDefaults() *SmsPrice { return &this } -// GetCurrency returns the Currency field value if set, zero value otherwise. -func (o *SmsPrice) GetCurrency() string { - if o == nil || o.Currency == nil { - var ret string +// GetPricePerMessage returns the PricePerMessage field value if set, zero value otherwise. +func (o *SmsPrice) GetPricePerMessage() float64 { + if o == nil || o.PricePerMessage == nil { + var ret float64 return ret } - return *o.Currency + return *o.PricePerMessage } -// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// GetPricePerMessageOk returns a tuple with the PricePerMessage field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SmsPrice) GetCurrencyOk() (*string, bool) { - if o == nil || o.Currency == nil { +func (o *SmsPrice) GetPricePerMessageOk() (*float64, bool) { + if o == nil || o.PricePerMessage == nil { return nil, false } - return o.Currency, true + return o.PricePerMessage, true } -// HasCurrency returns a boolean if a field has been set. -func (o *SmsPrice) HasCurrency() bool { - if o != nil && o.Currency != nil { +// HasPricePerMessage returns a boolean if a field has been set. +func (o *SmsPrice) HasPricePerMessage() bool { + if o != nil && o.PricePerMessage != nil { return true } return false } -// SetCurrency gets a reference to the given string and assigns it to the Currency field. -func (o *SmsPrice) SetCurrency(v string) { - o.Currency = &v +// SetPricePerMessage gets a reference to the given float64 and assigns it to the PricePerMessage field. +func (o *SmsPrice) SetPricePerMessage(v float64) { + o.PricePerMessage = &v } -// GetPricePerMessage returns the PricePerMessage field value if set, zero value otherwise. -func (o *SmsPrice) GetPricePerMessage() float64 { - if o == nil || o.PricePerMessage == nil { - var ret float64 +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *SmsPrice) GetCurrency() string { + if o == nil || o.Currency == nil { + var ret string return ret } - return *o.PricePerMessage + return *o.Currency } -// GetPricePerMessageOk returns a tuple with the PricePerMessage field value if set, nil otherwise +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SmsPrice) GetPricePerMessageOk() (*float64, bool) { - if o == nil || o.PricePerMessage == nil { +func (o *SmsPrice) GetCurrencyOk() (*string, bool) { + if o == nil || o.Currency == nil { return nil, false } - return o.PricePerMessage, true + return o.Currency, true } -// HasPricePerMessage returns a boolean if a field has been set. -func (o *SmsPrice) HasPricePerMessage() bool { - if o != nil && o.PricePerMessage != nil { +// HasCurrency returns a boolean if a field has been set. +func (o *SmsPrice) HasCurrency() bool { + if o != nil && o.Currency != nil { return true } return false } -// SetPricePerMessage gets a reference to the given float64 and assigns it to the PricePerMessage field. -func (o *SmsPrice) SetPricePerMessage(v float64) { - o.PricePerMessage = &v +// SetCurrency gets a reference to the given string and assigns it to the Currency field. +func (o *SmsPrice) SetCurrency(v string) { + o.Currency = &v } func (o SmsPrice) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Currency != nil { - toSerialize["currency"] = o.Currency - } if o.PricePerMessage != nil { toSerialize["pricePerMessage"] = o.PricePerMessage } + if o.Currency != nil { + toSerialize["currency"] = o.Currency + } return json.Marshal(toSerialize) } diff --git a/v2/model_sms_regional_options.go b/v2/model_sms_regional_options.go index 3dc7125..a1d4a29 100644 --- a/v2/model_sms_regional_options.go +++ b/v2/model_sms_regional_options.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -15,10 +14,10 @@ import ( "encoding/json" ) -// SmsRegionalOptions struct for SmsRegionalOptions +// SmsRegionalOptions Region-specific parameters, often imposed by local laws. Use this, if country or region that you are sending an SMS to requires additional information. type SmsRegionalOptions struct { - // Distributed Ledger Technology (DLT) specific parameters required for sending SMS to phone numbers registered in India. - IndiaDlt *SmsIndiaDltOptions `json:"indiaDlt,omitempty"` + IndiaDlt *SmsIndiaDltOptions `json:"indiaDlt,omitempty"` + TurkeyIys *SmsTurkeyIysOptions `json:"turkeyIys,omitempty"` } // NewSmsRegionalOptions instantiates a new SmsRegionalOptions object @@ -70,11 +69,46 @@ func (o *SmsRegionalOptions) SetIndiaDlt(v SmsIndiaDltOptions) { o.IndiaDlt = &v } +// GetTurkeyIys returns the TurkeyIys field value if set, zero value otherwise. +func (o *SmsRegionalOptions) GetTurkeyIys() SmsTurkeyIysOptions { + if o == nil || o.TurkeyIys == nil { + var ret SmsTurkeyIysOptions + return ret + } + return *o.TurkeyIys +} + +// GetTurkeyIysOk returns a tuple with the TurkeyIys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmsRegionalOptions) GetTurkeyIysOk() (*SmsTurkeyIysOptions, bool) { + if o == nil || o.TurkeyIys == nil { + return nil, false + } + return o.TurkeyIys, true +} + +// HasTurkeyIys returns a boolean if a field has been set. +func (o *SmsRegionalOptions) HasTurkeyIys() bool { + if o != nil && o.TurkeyIys != nil { + return true + } + + return false +} + +// SetTurkeyIys gets a reference to the given SmsTurkeyIysOptions and assigns it to the TurkeyIys field. +func (o *SmsRegionalOptions) SetTurkeyIys(v SmsTurkeyIysOptions) { + o.TurkeyIys = &v +} + func (o SmsRegionalOptions) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.IndiaDlt != nil { toSerialize["indiaDlt"] = o.IndiaDlt } + if o.TurkeyIys != nil { + toSerialize["turkeyIys"] = o.TurkeyIys + } return json.Marshal(toSerialize) } diff --git a/v2/model_sms_report.go b/v2/model_sms_report.go index de228a8..fc21df6 100644 --- a/v2/model_sms_report.go +++ b/v2/model_sms_report.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,30 +16,31 @@ import ( // SmsReport struct for SmsReport type SmsReport struct { - // Bulk ID. + // Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. BulkId *string `json:"bulkId,omitempty"` - // Callback data sent through `callbackData` field in fully featured SMS message. - CallbackData *string `json:"callbackData,omitempty"` - // Tells when the SMS was finished processing by Infobip (i.e., delivered to the destination, delivered to the destination network, etc.). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. - DoneAt *Time `json:"doneAt,omitempty"` - // Indicates whether the error occurred during the query execution. - Error *SmsError `json:"error,omitempty"` - // Sender ID that can be alphanumeric or numeric. - From *string `json:"from,omitempty"` - // Mobile country and network codes. - MccMnc *string `json:"mccMnc,omitempty"` - // Message ID. + // Unique message ID. MessageId *string `json:"messageId,omitempty"` - // Sent SMS price. - Price *SmsPrice `json:"price,omitempty"` - // Tells when the SMS was sent. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. + // Message destination address. + To *string `json:"to,omitempty"` + // The sender ID which can be alphanumeric or numeric (e.g., `CompanyName`). + From *string `json:"from,omitempty"` + // Date and time when the message was [scheduled](#channels/sms/get-scheduled-sms-messages) to be sent. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. SentAt *Time `json:"sentAt,omitempty"` - // The number of parts the sent SMS was split into. + // Date and time when the Infobip services finished processing the message (i.e., delivered to the destination, delivered to the destination network, etc.). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. + DoneAt *Time `json:"doneAt,omitempty"` + // The number of parts the message content was split into. SmsCount *int32 `json:"smsCount,omitempty"` - // Indicates whether the message is successfully sent, not sent, delivered, not delivered, waiting for delivery or any other possible status. - Status *SmsStatus `json:"status,omitempty"` - // Destination address. - To *string `json:"to,omitempty"` + // Mobile country and network codes. + MccMnc *string `json:"mccMnc,omitempty"` + // Custom data sent over to the `notifyUrl`. + CallbackData *string `json:"callbackData,omitempty"` + Price *SmsPrice `json:"price,omitempty"` + Status *SmsStatus `json:"status,omitempty"` + Error *SmsError `json:"error,omitempty"` + // The entity used when sending the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). + EntityId *string `json:"entityId,omitempty"` + // The application used when sending the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). + ApplicationId *string `json:"applicationId,omitempty"` } // NewSmsReport instantiates a new SmsReport object @@ -92,132 +92,196 @@ func (o *SmsReport) SetBulkId(v string) { o.BulkId = &v } -// GetCallbackData returns the CallbackData field value if set, zero value otherwise. -func (o *SmsReport) GetCallbackData() string { - if o == nil || o.CallbackData == nil { +// GetMessageId returns the MessageId field value if set, zero value otherwise. +func (o *SmsReport) GetMessageId() string { + if o == nil || o.MessageId == nil { var ret string return ret } - return *o.CallbackData + return *o.MessageId } -// GetCallbackDataOk returns a tuple with the CallbackData field value if set, nil otherwise +// GetMessageIdOk returns a tuple with the MessageId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SmsReport) GetCallbackDataOk() (*string, bool) { - if o == nil || o.CallbackData == nil { +func (o *SmsReport) GetMessageIdOk() (*string, bool) { + if o == nil || o.MessageId == nil { return nil, false } - return o.CallbackData, true + return o.MessageId, true } -// HasCallbackData returns a boolean if a field has been set. -func (o *SmsReport) HasCallbackData() bool { - if o != nil && o.CallbackData != nil { +// HasMessageId returns a boolean if a field has been set. +func (o *SmsReport) HasMessageId() bool { + if o != nil && o.MessageId != nil { return true } return false } -// SetCallbackData gets a reference to the given string and assigns it to the CallbackData field. -func (o *SmsReport) SetCallbackData(v string) { - o.CallbackData = &v +// SetMessageId gets a reference to the given string and assigns it to the MessageId field. +func (o *SmsReport) SetMessageId(v string) { + o.MessageId = &v } -// GetDoneAt returns the DoneAt field value if set, zero value otherwise. -func (o *SmsReport) GetDoneAt() Time { - if o == nil || o.DoneAt == nil { +// GetTo returns the To field value if set, zero value otherwise. +func (o *SmsReport) GetTo() string { + if o == nil || o.To == nil { + var ret string + return ret + } + return *o.To +} + +// GetToOk returns a tuple with the To field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmsReport) GetToOk() (*string, bool) { + if o == nil || o.To == nil { + return nil, false + } + return o.To, true +} + +// HasTo returns a boolean if a field has been set. +func (o *SmsReport) HasTo() bool { + if o != nil && o.To != nil { + return true + } + + return false +} + +// SetTo gets a reference to the given string and assigns it to the To field. +func (o *SmsReport) SetTo(v string) { + o.To = &v +} + +// GetFrom returns the From field value if set, zero value otherwise. +func (o *SmsReport) GetFrom() string { + if o == nil || o.From == nil { + var ret string + return ret + } + return *o.From +} + +// GetFromOk returns a tuple with the From field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmsReport) GetFromOk() (*string, bool) { + if o == nil || o.From == nil { + return nil, false + } + return o.From, true +} + +// HasFrom returns a boolean if a field has been set. +func (o *SmsReport) HasFrom() bool { + if o != nil && o.From != nil { + return true + } + + return false +} + +// SetFrom gets a reference to the given string and assigns it to the From field. +func (o *SmsReport) SetFrom(v string) { + o.From = &v +} + +// GetSentAt returns the SentAt field value if set, zero value otherwise. +func (o *SmsReport) GetSentAt() Time { + if o == nil || o.SentAt == nil { var ret Time return ret } - return *o.DoneAt + return *o.SentAt } -// GetDoneAtOk returns a tuple with the DoneAt field value if set, nil otherwise +// GetSentAtOk returns a tuple with the SentAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SmsReport) GetDoneAtOk() (*Time, bool) { - if o == nil || o.DoneAt == nil { +func (o *SmsReport) GetSentAtOk() (*Time, bool) { + if o == nil || o.SentAt == nil { return nil, false } - return o.DoneAt, true + return o.SentAt, true } -// HasDoneAt returns a boolean if a field has been set. -func (o *SmsReport) HasDoneAt() bool { - if o != nil && o.DoneAt != nil { +// HasSentAt returns a boolean if a field has been set. +func (o *SmsReport) HasSentAt() bool { + if o != nil && o.SentAt != nil { return true } return false } -// SetDoneAt gets a reference to the given Time and assigns it to the DoneAt field. -func (o *SmsReport) SetDoneAt(v Time) { - o.DoneAt = &v +// SetSentAt gets a reference to the given Time and assigns it to the SentAt field. +func (o *SmsReport) SetSentAt(v Time) { + o.SentAt = &v } -// GetError returns the Error field value if set, zero value otherwise. -func (o *SmsReport) GetError() SmsError { - if o == nil || o.Error == nil { - var ret SmsError +// GetDoneAt returns the DoneAt field value if set, zero value otherwise. +func (o *SmsReport) GetDoneAt() Time { + if o == nil || o.DoneAt == nil { + var ret Time return ret } - return *o.Error + return *o.DoneAt } -// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// GetDoneAtOk returns a tuple with the DoneAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SmsReport) GetErrorOk() (*SmsError, bool) { - if o == nil || o.Error == nil { +func (o *SmsReport) GetDoneAtOk() (*Time, bool) { + if o == nil || o.DoneAt == nil { return nil, false } - return o.Error, true + return o.DoneAt, true } -// HasError returns a boolean if a field has been set. -func (o *SmsReport) HasError() bool { - if o != nil && o.Error != nil { +// HasDoneAt returns a boolean if a field has been set. +func (o *SmsReport) HasDoneAt() bool { + if o != nil && o.DoneAt != nil { return true } return false } -// SetError gets a reference to the given SmsError and assigns it to the Error field. -func (o *SmsReport) SetError(v SmsError) { - o.Error = &v +// SetDoneAt gets a reference to the given Time and assigns it to the DoneAt field. +func (o *SmsReport) SetDoneAt(v Time) { + o.DoneAt = &v } -// GetFrom returns the From field value if set, zero value otherwise. -func (o *SmsReport) GetFrom() string { - if o == nil || o.From == nil { - var ret string +// GetSmsCount returns the SmsCount field value if set, zero value otherwise. +func (o *SmsReport) GetSmsCount() int32 { + if o == nil || o.SmsCount == nil { + var ret int32 return ret } - return *o.From + return *o.SmsCount } -// GetFromOk returns a tuple with the From field value if set, nil otherwise +// GetSmsCountOk returns a tuple with the SmsCount field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SmsReport) GetFromOk() (*string, bool) { - if o == nil || o.From == nil { +func (o *SmsReport) GetSmsCountOk() (*int32, bool) { + if o == nil || o.SmsCount == nil { return nil, false } - return o.From, true + return o.SmsCount, true } -// HasFrom returns a boolean if a field has been set. -func (o *SmsReport) HasFrom() bool { - if o != nil && o.From != nil { +// HasSmsCount returns a boolean if a field has been set. +func (o *SmsReport) HasSmsCount() bool { + if o != nil && o.SmsCount != nil { return true } return false } -// SetFrom gets a reference to the given string and assigns it to the From field. -func (o *SmsReport) SetFrom(v string) { - o.From = &v +// SetSmsCount gets a reference to the given int32 and assigns it to the SmsCount field. +func (o *SmsReport) SetSmsCount(v int32) { + o.SmsCount = &v } // GetMccMnc returns the MccMnc field value if set, zero value otherwise. @@ -252,36 +316,36 @@ func (o *SmsReport) SetMccMnc(v string) { o.MccMnc = &v } -// GetMessageId returns the MessageId field value if set, zero value otherwise. -func (o *SmsReport) GetMessageId() string { - if o == nil || o.MessageId == nil { +// GetCallbackData returns the CallbackData field value if set, zero value otherwise. +func (o *SmsReport) GetCallbackData() string { + if o == nil || o.CallbackData == nil { var ret string return ret } - return *o.MessageId + return *o.CallbackData } -// GetMessageIdOk returns a tuple with the MessageId field value if set, nil otherwise +// GetCallbackDataOk returns a tuple with the CallbackData field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SmsReport) GetMessageIdOk() (*string, bool) { - if o == nil || o.MessageId == nil { +func (o *SmsReport) GetCallbackDataOk() (*string, bool) { + if o == nil || o.CallbackData == nil { return nil, false } - return o.MessageId, true + return o.CallbackData, true } -// HasMessageId returns a boolean if a field has been set. -func (o *SmsReport) HasMessageId() bool { - if o != nil && o.MessageId != nil { +// HasCallbackData returns a boolean if a field has been set. +func (o *SmsReport) HasCallbackData() bool { + if o != nil && o.CallbackData != nil { return true } return false } -// SetMessageId gets a reference to the given string and assigns it to the MessageId field. -func (o *SmsReport) SetMessageId(v string) { - o.MessageId = &v +// SetCallbackData gets a reference to the given string and assigns it to the CallbackData field. +func (o *SmsReport) SetCallbackData(v string) { + o.CallbackData = &v } // GetPrice returns the Price field value if set, zero value otherwise. @@ -316,132 +380,132 @@ func (o *SmsReport) SetPrice(v SmsPrice) { o.Price = &v } -// GetSentAt returns the SentAt field value if set, zero value otherwise. -func (o *SmsReport) GetSentAt() Time { - if o == nil || o.SentAt == nil { - var ret Time +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *SmsReport) GetStatus() SmsStatus { + if o == nil || o.Status == nil { + var ret SmsStatus return ret } - return *o.SentAt + return *o.Status } -// GetSentAtOk returns a tuple with the SentAt field value if set, nil otherwise +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SmsReport) GetSentAtOk() (*Time, bool) { - if o == nil || o.SentAt == nil { +func (o *SmsReport) GetStatusOk() (*SmsStatus, bool) { + if o == nil || o.Status == nil { return nil, false } - return o.SentAt, true + return o.Status, true } -// HasSentAt returns a boolean if a field has been set. -func (o *SmsReport) HasSentAt() bool { - if o != nil && o.SentAt != nil { +// HasStatus returns a boolean if a field has been set. +func (o *SmsReport) HasStatus() bool { + if o != nil && o.Status != nil { return true } return false } -// SetSentAt gets a reference to the given Time and assigns it to the SentAt field. -func (o *SmsReport) SetSentAt(v Time) { - o.SentAt = &v +// SetStatus gets a reference to the given SmsStatus and assigns it to the Status field. +func (o *SmsReport) SetStatus(v SmsStatus) { + o.Status = &v } -// GetSmsCount returns the SmsCount field value if set, zero value otherwise. -func (o *SmsReport) GetSmsCount() int32 { - if o == nil || o.SmsCount == nil { - var ret int32 +// GetError returns the Error field value if set, zero value otherwise. +func (o *SmsReport) GetError() SmsError { + if o == nil || o.Error == nil { + var ret SmsError return ret } - return *o.SmsCount + return *o.Error } -// GetSmsCountOk returns a tuple with the SmsCount field value if set, nil otherwise +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SmsReport) GetSmsCountOk() (*int32, bool) { - if o == nil || o.SmsCount == nil { +func (o *SmsReport) GetErrorOk() (*SmsError, bool) { + if o == nil || o.Error == nil { return nil, false } - return o.SmsCount, true + return o.Error, true } -// HasSmsCount returns a boolean if a field has been set. -func (o *SmsReport) HasSmsCount() bool { - if o != nil && o.SmsCount != nil { +// HasError returns a boolean if a field has been set. +func (o *SmsReport) HasError() bool { + if o != nil && o.Error != nil { return true } return false } -// SetSmsCount gets a reference to the given int32 and assigns it to the SmsCount field. -func (o *SmsReport) SetSmsCount(v int32) { - o.SmsCount = &v +// SetError gets a reference to the given SmsError and assigns it to the Error field. +func (o *SmsReport) SetError(v SmsError) { + o.Error = &v } -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *SmsReport) GetStatus() SmsStatus { - if o == nil || o.Status == nil { - var ret SmsStatus +// GetEntityId returns the EntityId field value if set, zero value otherwise. +func (o *SmsReport) GetEntityId() string { + if o == nil || o.EntityId == nil { + var ret string return ret } - return *o.Status + return *o.EntityId } -// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// GetEntityIdOk returns a tuple with the EntityId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SmsReport) GetStatusOk() (*SmsStatus, bool) { - if o == nil || o.Status == nil { +func (o *SmsReport) GetEntityIdOk() (*string, bool) { + if o == nil || o.EntityId == nil { return nil, false } - return o.Status, true + return o.EntityId, true } -// HasStatus returns a boolean if a field has been set. -func (o *SmsReport) HasStatus() bool { - if o != nil && o.Status != nil { +// HasEntityId returns a boolean if a field has been set. +func (o *SmsReport) HasEntityId() bool { + if o != nil && o.EntityId != nil { return true } return false } -// SetStatus gets a reference to the given SmsStatus and assigns it to the Status field. -func (o *SmsReport) SetStatus(v SmsStatus) { - o.Status = &v +// SetEntityId gets a reference to the given string and assigns it to the EntityId field. +func (o *SmsReport) SetEntityId(v string) { + o.EntityId = &v } -// GetTo returns the To field value if set, zero value otherwise. -func (o *SmsReport) GetTo() string { - if o == nil || o.To == nil { +// GetApplicationId returns the ApplicationId field value if set, zero value otherwise. +func (o *SmsReport) GetApplicationId() string { + if o == nil || o.ApplicationId == nil { var ret string return ret } - return *o.To + return *o.ApplicationId } -// GetToOk returns a tuple with the To field value if set, nil otherwise +// GetApplicationIdOk returns a tuple with the ApplicationId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SmsReport) GetToOk() (*string, bool) { - if o == nil || o.To == nil { +func (o *SmsReport) GetApplicationIdOk() (*string, bool) { + if o == nil || o.ApplicationId == nil { return nil, false } - return o.To, true + return o.ApplicationId, true } -// HasTo returns a boolean if a field has been set. -func (o *SmsReport) HasTo() bool { - if o != nil && o.To != nil { +// HasApplicationId returns a boolean if a field has been set. +func (o *SmsReport) HasApplicationId() bool { + if o != nil && o.ApplicationId != nil { return true } return false } -// SetTo gets a reference to the given string and assigns it to the To field. -func (o *SmsReport) SetTo(v string) { - o.To = &v +// SetApplicationId gets a reference to the given string and assigns it to the ApplicationId field. +func (o *SmsReport) SetApplicationId(v string) { + o.ApplicationId = &v } func (o SmsReport) MarshalJSON() ([]byte, error) { @@ -449,38 +513,44 @@ func (o SmsReport) MarshalJSON() ([]byte, error) { if o.BulkId != nil { toSerialize["bulkId"] = o.BulkId } - if o.CallbackData != nil { - toSerialize["callbackData"] = o.CallbackData - } - if o.DoneAt != nil { - toSerialize["doneAt"] = o.DoneAt + if o.MessageId != nil { + toSerialize["messageId"] = o.MessageId } - if o.Error != nil { - toSerialize["error"] = o.Error + if o.To != nil { + toSerialize["to"] = o.To } if o.From != nil { toSerialize["from"] = o.From } + if o.SentAt != nil { + toSerialize["sentAt"] = o.SentAt + } + if o.DoneAt != nil { + toSerialize["doneAt"] = o.DoneAt + } + if o.SmsCount != nil { + toSerialize["smsCount"] = o.SmsCount + } if o.MccMnc != nil { toSerialize["mccMnc"] = o.MccMnc } - if o.MessageId != nil { - toSerialize["messageId"] = o.MessageId + if o.CallbackData != nil { + toSerialize["callbackData"] = o.CallbackData } if o.Price != nil { toSerialize["price"] = o.Price } - if o.SentAt != nil { - toSerialize["sentAt"] = o.SentAt - } - if o.SmsCount != nil { - toSerialize["smsCount"] = o.SmsCount - } if o.Status != nil { toSerialize["status"] = o.Status } - if o.To != nil { - toSerialize["to"] = o.To + if o.Error != nil { + toSerialize["error"] = o.Error + } + if o.EntityId != nil { + toSerialize["entityId"] = o.EntityId + } + if o.ApplicationId != nil { + toSerialize["applicationId"] = o.ApplicationId } return json.Marshal(toSerialize) } diff --git a/v2/model_sms_response.go b/v2/model_sms_response.go index 9a8a863..a60b25c 100644 --- a/v2/model_sms_response.go +++ b/v2/model_sms_response.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,9 +16,9 @@ import ( // SmsResponse struct for SmsResponse type SmsResponse struct { - // The ID that uniquely identifies the request. Bulk ID will be received only when you send a message to more than one destination address. + // Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. Typically, used to fetch [delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports) and [message logs](#channels/sms/get-outbound-sms-message-logs). BulkId *string `json:"bulkId,omitempty"` - // Array of sent message objects, one object per every message. + // An array of message objects of a single message or multiple messages sent under one bulk ID. Messages *[]SmsResponseDetails `json:"messages,omitempty"` } diff --git a/v2/model_sms_response_details.go b/v2/model_sms_response_details.go index 16e98f3..a8d1f0b 100644 --- a/v2/model_sms_response_details.go +++ b/v2/model_sms_response_details.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -15,14 +14,15 @@ import ( "encoding/json" ) -// SmsResponseDetails struct for SmsResponseDetails +// SmsResponseDetails An array of message objects of a single message or multiple messages sent under one bulk ID. type SmsResponseDetails struct { - // The ID that uniquely identifies the message sent. - MessageId *string `json:"messageId,omitempty"` - // Indicates whether the message is successfully sent, not sent, delivered, not delivered, waiting for delivery or any other possible status. - Status *SmsStatus `json:"status,omitempty"` - // The message destination address. + // Unique message ID. If not passed, it will be automatically generated and returned in a response. + MessageId *string `json:"messageId,omitempty"` + Status *SmsStatus `json:"status,omitempty"` + // The destination address of the message. To *string `json:"to,omitempty"` + // This is the total count of SMS submitted in the request. SMS messages have a character limit and messages longer than that limit will be split into multiple SMS and reflected in the total count of SMS submitted. + SmsCount *int32 `json:"smsCount,omitempty"` } // NewSmsResponseDetails instantiates a new SmsResponseDetails object @@ -138,6 +138,38 @@ func (o *SmsResponseDetails) SetTo(v string) { o.To = &v } +// GetSmsCount returns the SmsCount field value if set, zero value otherwise. +func (o *SmsResponseDetails) GetSmsCount() int32 { + if o == nil || o.SmsCount == nil { + var ret int32 + return ret + } + return *o.SmsCount +} + +// GetSmsCountOk returns a tuple with the SmsCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmsResponseDetails) GetSmsCountOk() (*int32, bool) { + if o == nil || o.SmsCount == nil { + return nil, false + } + return o.SmsCount, true +} + +// HasSmsCount returns a boolean if a field has been set. +func (o *SmsResponseDetails) HasSmsCount() bool { + if o != nil && o.SmsCount != nil { + return true + } + + return false +} + +// SetSmsCount gets a reference to the given int32 and assigns it to the SmsCount field. +func (o *SmsResponseDetails) SetSmsCount(v int32) { + o.SmsCount = &v +} + func (o SmsResponseDetails) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.MessageId != nil { @@ -149,6 +181,9 @@ func (o SmsResponseDetails) MarshalJSON() ([]byte, error) { if o.To != nil { toSerialize["to"] = o.To } + if o.SmsCount != nil { + toSerialize["smsCount"] = o.SmsCount + } return json.Marshal(toSerialize) } diff --git a/v2/model_sms_sending_speed_limit.go b/v2/model_sms_sending_speed_limit.go index 3f652cf..d6684da 100644 --- a/v2/model_sms_sending_speed_limit.go +++ b/v2/model_sms_sending_speed_limit.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -15,11 +14,10 @@ import ( "encoding/json" ) -// SmsSendingSpeedLimit struct for SmsSendingSpeedLimit +// SmsSendingSpeedLimit Limits the send speed when sending messages in bulk to deliver messages over a longer period of time. You may wish to use this to allow your systems or agents to handle large amounts of incoming traffic, e.g., if you are expecting recipients to follow through with a call-to-action option from a message you sent. Not setting a send speed limit can overwhelm your resources with incoming traffic. type SmsSendingSpeedLimit struct { - // The number of messages to send per time unit. By default, Infobip sends your messages as fast as the infrastructure allows. Use this parameter to reduce the traffic if you find the default sending speed too fast for your use case. Note that boosting this parameter will not result in faster sending speeds beyond infrastructure capabilities. - Amount int32 `json:"amount"` - // The time unit in which the defined message amount will be sent. The default value is `MINUTE`. + // The number of messages to be sent per timeUnit. By default, the system sends messages as fast as the infrastructure allows. Use this parameter to adapt sending capacity to your needs. The system is only able to work against its maximum capacity for ambitious message batches. + Amount int32 `json:"amount"` TimeUnit *SmsSpeedLimitTimeUnit `json:"timeUnit,omitempty"` } @@ -30,6 +28,8 @@ type SmsSendingSpeedLimit struct { func NewSmsSendingSpeedLimit(amount int32) *SmsSendingSpeedLimit { this := SmsSendingSpeedLimit{} this.Amount = amount + var timeUnit SmsSpeedLimitTimeUnit = SMSSPEEDLIMITTIMEUNIT_MINUTE + this.TimeUnit = &timeUnit return &this } @@ -38,6 +38,8 @@ func NewSmsSendingSpeedLimit(amount int32) *SmsSendingSpeedLimit { // but it doesn't guarantee that properties required by API are set func NewSmsSendingSpeedLimitWithDefaults() *SmsSendingSpeedLimit { this := SmsSendingSpeedLimit{} + var timeUnit SmsSpeedLimitTimeUnit = SMSSPEEDLIMITTIMEUNIT_MINUTE + this.TimeUnit = &timeUnit return &this } diff --git a/v2/model_sms_speed_limit_time_unit.go b/v2/model_sms_speed_limit_time_unit.go index f361534..ab91b6e 100644 --- a/v2/model_sms_speed_limit_time_unit.go +++ b/v2/model_sms_speed_limit_time_unit.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -16,7 +15,7 @@ import ( "fmt" ) -// SmsSpeedLimitTimeUnit the model 'SmsSpeedLimitTimeUnit' +// SmsSpeedLimitTimeUnit The time unit to define when setting a messaging speed limit. Defaults to `MINUTE`. type SmsSpeedLimitTimeUnit string // List of SmsSpeedLimitTimeUnit diff --git a/v2/model_sms_status.go b/v2/model_sms_status.go index 95f15be..019969a 100644 --- a/v2/model_sms_status.go +++ b/v2/model_sms_status.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -15,20 +14,20 @@ import ( "encoding/json" ) -// SmsStatus struct for SmsStatus +// SmsStatus Indicates the [status](https://www.infobip.com/docs/essentials/response-status-and-error-codes#api-status-codes) of the message and how to recover from an error should there be any. type SmsStatus struct { - // Action that should be taken to eliminate the error. - Action *string `json:"action,omitempty"` - // Human-readable description of the status. - Description *string `json:"description,omitempty"` // Status group ID. GroupId *int32 `json:"groupId,omitempty"` - // Status group name. + // Status group name that describes which category the status code belongs to, e.g. PENDING, UNDELIVERABLE, DELIVERED, EXPIRED, REJECTED. GroupName *string `json:"groupName,omitempty"` // Status ID. Id *int32 `json:"id,omitempty"` - // Status name. + // [Status name](https://www.infobip.com/docs/essentials/response-status-and-error-codes). Name *string `json:"name,omitempty"` + // Human-readable description of the status. + Description *string `json:"description,omitempty"` + // Action that should be taken to recover from the error. + Action *string `json:"action,omitempty"` } // NewSmsStatus instantiates a new SmsStatus object @@ -48,70 +47,6 @@ func NewSmsStatusWithDefaults() *SmsStatus { return &this } -// GetAction returns the Action field value if set, zero value otherwise. -func (o *SmsStatus) GetAction() string { - if o == nil || o.Action == nil { - var ret string - return ret - } - return *o.Action -} - -// GetActionOk returns a tuple with the Action field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SmsStatus) GetActionOk() (*string, bool) { - if o == nil || o.Action == nil { - return nil, false - } - return o.Action, true -} - -// HasAction returns a boolean if a field has been set. -func (o *SmsStatus) HasAction() bool { - if o != nil && o.Action != nil { - return true - } - - return false -} - -// SetAction gets a reference to the given string and assigns it to the Action field. -func (o *SmsStatus) SetAction(v string) { - o.Action = &v -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *SmsStatus) GetDescription() string { - if o == nil || o.Description == nil { - var ret string - return ret - } - return *o.Description -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SmsStatus) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *SmsStatus) HasDescription() bool { - if o != nil && o.Description != nil { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *SmsStatus) SetDescription(v string) { - o.Description = &v -} - // GetGroupId returns the GroupId field value if set, zero value otherwise. func (o *SmsStatus) GetGroupId() int32 { if o == nil || o.GroupId == nil { @@ -240,14 +175,72 @@ func (o *SmsStatus) SetName(v string) { o.Name = &v } -func (o SmsStatus) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Action != nil { - toSerialize["action"] = o.Action +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SmsStatus) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret } - if o.Description != nil { - toSerialize["description"] = o.Description + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmsStatus) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SmsStatus) HasDescription() bool { + if o != nil && o.Description != nil { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SmsStatus) SetDescription(v string) { + o.Description = &v +} + +// GetAction returns the Action field value if set, zero value otherwise. +func (o *SmsStatus) GetAction() string { + if o == nil || o.Action == nil { + var ret string + return ret + } + return *o.Action +} + +// GetActionOk returns a tuple with the Action field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmsStatus) GetActionOk() (*string, bool) { + if o == nil || o.Action == nil { + return nil, false + } + return o.Action, true +} + +// HasAction returns a boolean if a field has been set. +func (o *SmsStatus) HasAction() bool { + if o != nil && o.Action != nil { + return true + } + + return false +} + +// SetAction gets a reference to the given string and assigns it to the Action field. +func (o *SmsStatus) SetAction(v string) { + o.Action = &v +} + +func (o SmsStatus) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} if o.GroupId != nil { toSerialize["groupId"] = o.GroupId } @@ -260,6 +253,12 @@ func (o SmsStatus) MarshalJSON() ([]byte, error) { if o.Name != nil { toSerialize["name"] = o.Name } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.Action != nil { + toSerialize["action"] = o.Action + } return json.Marshal(toSerialize) } diff --git a/v2/model_sms_textual_message.go b/v2/model_sms_textual_message.go index 6df6f45..d4cbe4b 100644 --- a/v2/model_sms_textual_message.go +++ b/v2/model_sms_textual_message.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -15,34 +14,37 @@ import ( "encoding/json" ) -// SmsTextualMessage struct for SmsTextualMessage +// SmsTextualMessage An array of message objects of a single message or multiple messages sent under one bulk ID. type SmsTextualMessage struct { - // Additional client's data that will be sent on the notifyUrl. The maximum value is 200 characters. - CallbackData *string `json:"callbackData,omitempty"` - // Scheduling object that allows setting up detailed time windows in which the message can be sent. Consists of `from`, `to` and `days` properties. `Days` property is mandatory. `From` and `to` properties should be either both included, to allow finer time window granulation or both omitted, to include whole days in the delivery time window. + // Additional data that can be used for identifying, managing, or monitoring a message. Data included here will also be automatically included in the message [Delivery Report](#channels/sms/get-outbound-sms-message-delivery-reports). The maximum value is 4000 characters and any overhead may be truncated. + CallbackData *string `json:"callbackData,omitempty"` DeliveryTimeWindow *SmsDeliveryTimeWindow `json:"deliveryTimeWindow,omitempty"` - Destinations *[]SmsDestination `json:"destinations,omitempty"` - // Can be `true` or `false`. If the value is set to `true`, a flash SMS will be sent. Otherwise, a normal SMS will be sent. The default value is `false`. + // An array of destination objects for where messages are being sent. A valid destination is required. + Destinations *[]SmsDestination `json:"destinations"` + // Allows for sending a [flash SMS](https://www.infobip.com/docs/sms/message-types#flash-sms) to automatically appear on recipient devices without interaction. Set to `true` to enable flash SMS, or leave the default value, `false` to send a standard SMS. Flash *bool `json:"flash,omitempty"` - // Represents a sender ID which can be alphanumeric or numeric. Alphanumeric sender ID length should be between 3 and 11 characters (Example: `CompanyName`). Numeric sender ID length should be between 3 and 14 characters. + // The sender ID which can be alphanumeric or numeric (e.g., `CompanyName`). Make sure you don't exceed [character limit](https://www.infobip.com/docs/sms/get-started#sender-names). From *string `json:"from,omitempty"` - // The real-time Intermediate delivery report that will be sent on your callback server. Can be `true` or `false`. + // The [real-time intermediate delivery report](#channels/sms/receive-outbound-sms-message-report) containing GSM error codes, messages status, pricing, network and country codes, etc., which will be sent on your callback server. Defaults to `false`. IntermediateReport *bool `json:"intermediateReport,omitempty"` Language *SmsLanguage `json:"language,omitempty"` - // Preferred Delivery report content type. Can be `application/json` or `application/xml`. + // Preferred delivery report content type, `application/json` or `application/xml`. NotifyContentType *string `json:"notifyContentType,omitempty"` - // The URL on your call back server on which the Delivery report will be sent. - NotifyUrl *string `json:"notifyUrl,omitempty"` - // Region specific parameters, often specified by local laws. Use this if country or region that you are sending SMS to requires some extra parameters. - Regional *SmsRegionalOptions `json:"regional,omitempty"` - // Date and time when the message is to be sent. Used for scheduled SMS (SMS not sent immediately, but at the scheduled time). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. + // The URL on your call back server on to which a delivery report will be sent. The [retry cycle](https://www.infobip.com/docs/sms/api#notify-url) for when your URL becomes unavailable uses the following formula: `1min + (1min * retryNumber * retryNumber)`. + NotifyUrl *string `json:"notifyUrl,omitempty"` + Regional *SmsRegionalOptions `json:"regional,omitempty"` + // Date and time when the message is to be sent. Used for [scheduled SMS](#channels/sms/get-scheduled-sms-messages). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`, and can only be scheduled for no later than 180 days in advance. SendAt *Time `json:"sendAt,omitempty"` - // Text of the message that will be sent. + // Content of the message being sent. Text *string `json:"text,omitempty"` - // Conversion of a message text from one script to another. Possible values: `TURKISH`, `GREEK`, `CYRILLIC`, `SERBIAN_CYRILLIC`, `CENTRAL_EUROPEAN`, `BALTIC` and `NON_UNICODE`. + // The transliteration of your sent message from one script to another. Transliteration is used to replace characters which are not recognized as part of your defaulted alphabet. Possible values: `TURKISH`, `GREEK`, `CYRILLIC`, `SERBIAN_CYRILLIC`, `BULGARIAN_CYRILLIC`, `CENTRAL_EUROPEAN`, `BALTIC` and `NON_UNICODE`. Transliteration *string `json:"transliteration,omitempty"` - // The message validity period in minutes. When the period expires, it will not be allowed for the message to be sent. Validity period longer than 48h is not supported (in this case, it will be automatically set to 48h). + // The message validity period in minutes. When the period expires, it will not be allowed for the message to be sent. Validity period longer than 48h is not supported. Any bigger value will automatically default back to `2880`. ValidityPeriod *int64 `json:"validityPeriod,omitempty"` + // Required for entity use in a send request for outbound traffic. Returned in notification events. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). + EntityId *string `json:"entityId,omitempty"` + // Required for application use in a send request for outbound traffic. Returned in notification events. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). + ApplicationId *string `json:"applicationId,omitempty"` } // NewSmsTextualMessage instantiates a new SmsTextualMessage object @@ -51,6 +53,8 @@ type SmsTextualMessage struct { // will change when the set of required properties is changed func NewSmsTextualMessage() *SmsTextualMessage { this := SmsTextualMessage{} + var flash bool = false + this.Flash = &flash return &this } @@ -59,6 +63,8 @@ func NewSmsTextualMessage() *SmsTextualMessage { // but it doesn't guarantee that properties required by API are set func NewSmsTextualMessageWithDefaults() *SmsTextualMessage { this := SmsTextualMessage{} + var flash bool = false + this.Flash = &flash return &this } @@ -510,6 +516,70 @@ func (o *SmsTextualMessage) SetValidityPeriod(v int64) { o.ValidityPeriod = &v } +// GetEntityId returns the EntityId field value if set, zero value otherwise. +func (o *SmsTextualMessage) GetEntityId() string { + if o == nil || o.EntityId == nil { + var ret string + return ret + } + return *o.EntityId +} + +// GetEntityIdOk returns a tuple with the EntityId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmsTextualMessage) GetEntityIdOk() (*string, bool) { + if o == nil || o.EntityId == nil { + return nil, false + } + return o.EntityId, true +} + +// HasEntityId returns a boolean if a field has been set. +func (o *SmsTextualMessage) HasEntityId() bool { + if o != nil && o.EntityId != nil { + return true + } + + return false +} + +// SetEntityId gets a reference to the given string and assigns it to the EntityId field. +func (o *SmsTextualMessage) SetEntityId(v string) { + o.EntityId = &v +} + +// GetApplicationId returns the ApplicationId field value if set, zero value otherwise. +func (o *SmsTextualMessage) GetApplicationId() string { + if o == nil || o.ApplicationId == nil { + var ret string + return ret + } + return *o.ApplicationId +} + +// GetApplicationIdOk returns a tuple with the ApplicationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmsTextualMessage) GetApplicationIdOk() (*string, bool) { + if o == nil || o.ApplicationId == nil { + return nil, false + } + return o.ApplicationId, true +} + +// HasApplicationId returns a boolean if a field has been set. +func (o *SmsTextualMessage) HasApplicationId() bool { + if o != nil && o.ApplicationId != nil { + return true + } + + return false +} + +// SetApplicationId gets a reference to the given string and assigns it to the ApplicationId field. +func (o *SmsTextualMessage) SetApplicationId(v string) { + o.ApplicationId = &v +} + func (o SmsTextualMessage) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.CallbackData != nil { @@ -554,6 +624,12 @@ func (o SmsTextualMessage) MarshalJSON() ([]byte, error) { if o.ValidityPeriod != nil { toSerialize["validityPeriod"] = o.ValidityPeriod } + if o.EntityId != nil { + toSerialize["entityId"] = o.EntityId + } + if o.ApplicationId != nil { + toSerialize["applicationId"] = o.ApplicationId + } return json.Marshal(toSerialize) } diff --git a/v2/model_sms_tracking.go b/v2/model_sms_tracking.go index 8db785d..6437c61 100644 --- a/v2/model_sms_tracking.go +++ b/v2/model_sms_tracking.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -15,15 +14,15 @@ import ( "encoding/json" ) -// SmsTracking struct for SmsTracking +// SmsTracking Sets up tracking parameters to track conversion metrics and type. type SmsTracking struct { - // Custom base url used for shortening links from SMS text in `URL` Conversion rate tracking use-case. + // Custom base URL for shortened links in messages when tracking URL conversions. Legacy - use `urlOptions` instead. BaseUrl *string `json:"baseUrl,omitempty"` - // Key that uniquely identifies Conversion tracking process. + // The process key which uniquely identifies conversion tracking. ProcessKey *string `json:"processKey,omitempty"` - // Indicates if the message has to be tracked for Conversion rates. Possible values: `SMS` and `URL` + // Indicates if a message has to be tracked for conversion rates. Values are: `SMS` and `URL`. `URL` is a legacy value. Use `urlOptions` instead. For more details on SMS Conversion, see: [Track Conversion](https://www.infobip.com/docs/sms/api#track-conversion). Track *string `json:"track,omitempty"` - // User-defined type of the Conversion tracking process or flow type or message type, etc. Example: `ONE_TIME_PIN or SOCIAL_INVITES`. + // Sets a custom conversion type naming convention, e.g. `ONE_TIME_PIN` or `SOCIAL_INVITES`. Type *string `json:"type,omitempty"` } diff --git a/v2/model_sms_turkey_iys_options.go b/v2/model_sms_turkey_iys_options.go new file mode 100644 index 0000000..c0d4add --- /dev/null +++ b/v2/model_sms_turkey_iys_options.go @@ -0,0 +1,144 @@ +/* + * Infobip Client API Libraries OpenAPI Specification + * + * OpenAPI specification containing public endpoints supported in client API libraries. + * + * Contact: support@infobip.com + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package infobip + +import ( + "encoding/json" +) + +// SmsTurkeyIysOptions IYS regulations specific parameters required for sending promotional SMS to phone numbers registered in Turkey. +type SmsTurkeyIysOptions struct { + // Brand code is an ID of the company based on a company VAT number. If not provided in request, default value is used from your Infobip account. + BrandCode *int32 `json:"brandCode,omitempty"` + // Recipient Type must be `TACIR` or `BIREYSEL`. + RecipientType string `json:"recipientType"` +} + +// NewSmsTurkeyIysOptions instantiates a new SmsTurkeyIysOptions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSmsTurkeyIysOptions(recipientType string) *SmsTurkeyIysOptions { + this := SmsTurkeyIysOptions{} + this.RecipientType = recipientType + return &this +} + +// NewSmsTurkeyIysOptionsWithDefaults instantiates a new SmsTurkeyIysOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSmsTurkeyIysOptionsWithDefaults() *SmsTurkeyIysOptions { + this := SmsTurkeyIysOptions{} + return &this +} + +// GetBrandCode returns the BrandCode field value if set, zero value otherwise. +func (o *SmsTurkeyIysOptions) GetBrandCode() int32 { + if o == nil || o.BrandCode == nil { + var ret int32 + return ret + } + return *o.BrandCode +} + +// GetBrandCodeOk returns a tuple with the BrandCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmsTurkeyIysOptions) GetBrandCodeOk() (*int32, bool) { + if o == nil || o.BrandCode == nil { + return nil, false + } + return o.BrandCode, true +} + +// HasBrandCode returns a boolean if a field has been set. +func (o *SmsTurkeyIysOptions) HasBrandCode() bool { + if o != nil && o.BrandCode != nil { + return true + } + + return false +} + +// SetBrandCode gets a reference to the given int32 and assigns it to the BrandCode field. +func (o *SmsTurkeyIysOptions) SetBrandCode(v int32) { + o.BrandCode = &v +} + +// GetRecipientType returns the RecipientType field value +func (o *SmsTurkeyIysOptions) GetRecipientType() string { + if o == nil { + var ret string + return ret + } + + return o.RecipientType +} + +// GetRecipientTypeOk returns a tuple with the RecipientType field value +// and a boolean to check if the value has been set. +func (o *SmsTurkeyIysOptions) GetRecipientTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RecipientType, true +} + +// SetRecipientType sets field value +func (o *SmsTurkeyIysOptions) SetRecipientType(v string) { + o.RecipientType = v +} + +func (o SmsTurkeyIysOptions) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.BrandCode != nil { + toSerialize["brandCode"] = o.BrandCode + } + if true { + toSerialize["recipientType"] = o.RecipientType + } + return json.Marshal(toSerialize) +} + +type NullableSmsTurkeyIysOptions struct { + value *SmsTurkeyIysOptions + isSet bool +} + +func (v NullableSmsTurkeyIysOptions) Get() *SmsTurkeyIysOptions { + return v.value +} + +func (v *NullableSmsTurkeyIysOptions) Set(val *SmsTurkeyIysOptions) { + v.value = val + v.isSet = true +} + +func (v NullableSmsTurkeyIysOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableSmsTurkeyIysOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSmsTurkeyIysOptions(val *SmsTurkeyIysOptions) *NullableSmsTurkeyIysOptions { + return &NullableSmsTurkeyIysOptions{value: val, isSet: true} +} + +func (v NullableSmsTurkeyIysOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSmsTurkeyIysOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v2/model_sms_update_status_request.go b/v2/model_sms_update_status_request.go index 2bcb4b9..4b63320 100644 --- a/v2/model_sms_update_status_request.go +++ b/v2/model_sms_update_status_request.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ diff --git a/v2/model_sms_url_options.go b/v2/model_sms_url_options.go new file mode 100644 index 0000000..b22cf85 --- /dev/null +++ b/v2/model_sms_url_options.go @@ -0,0 +1,274 @@ +/* + * Infobip Client API Libraries OpenAPI Specification + * + * OpenAPI specification containing public endpoints supported in client API libraries. + * + * Contact: support@infobip.com + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package infobip + +import ( + "encoding/json" +) + +// SmsUrlOptions Sets up [URL shortening](https://www.infobip.com/docs/url-shortening) and tracking feature. Not compatible with old tracking feature. +type SmsUrlOptions struct { + // Enable shortening of the URLs within a message. Set this to `true`, if you want to set up other URL options. + ShortenUrl *bool `json:"shortenUrl,omitempty"` + // Enable tracking of short URL clicks within a message: which URL was clicked, how many times, and by whom. + TrackClicks *bool `json:"trackClicks,omitempty"` + // The URL of your callback server on to which the Click report will be sent. + TrackingUrl *string `json:"trackingUrl,omitempty"` + // Remove a protocol, such as `https://`, from links to shorten a message. Note that some mobiles may not recognize such links as a URL. + RemoveProtocol *bool `json:"removeProtocol,omitempty"` + // Select a predefined custom domain to use when generating a short URL. + CustomDomain *string `json:"customDomain,omitempty"` +} + +// NewSmsUrlOptions instantiates a new SmsUrlOptions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSmsUrlOptions() *SmsUrlOptions { + this := SmsUrlOptions{} + var shortenUrl bool = true + this.ShortenUrl = &shortenUrl + var trackClicks bool = true + this.TrackClicks = &trackClicks + var removeProtocol bool = false + this.RemoveProtocol = &removeProtocol + return &this +} + +// NewSmsUrlOptionsWithDefaults instantiates a new SmsUrlOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSmsUrlOptionsWithDefaults() *SmsUrlOptions { + this := SmsUrlOptions{} + var shortenUrl bool = true + this.ShortenUrl = &shortenUrl + var trackClicks bool = true + this.TrackClicks = &trackClicks + var removeProtocol bool = false + this.RemoveProtocol = &removeProtocol + return &this +} + +// GetShortenUrl returns the ShortenUrl field value if set, zero value otherwise. +func (o *SmsUrlOptions) GetShortenUrl() bool { + if o == nil || o.ShortenUrl == nil { + var ret bool + return ret + } + return *o.ShortenUrl +} + +// GetShortenUrlOk returns a tuple with the ShortenUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmsUrlOptions) GetShortenUrlOk() (*bool, bool) { + if o == nil || o.ShortenUrl == nil { + return nil, false + } + return o.ShortenUrl, true +} + +// HasShortenUrl returns a boolean if a field has been set. +func (o *SmsUrlOptions) HasShortenUrl() bool { + if o != nil && o.ShortenUrl != nil { + return true + } + + return false +} + +// SetShortenUrl gets a reference to the given bool and assigns it to the ShortenUrl field. +func (o *SmsUrlOptions) SetShortenUrl(v bool) { + o.ShortenUrl = &v +} + +// GetTrackClicks returns the TrackClicks field value if set, zero value otherwise. +func (o *SmsUrlOptions) GetTrackClicks() bool { + if o == nil || o.TrackClicks == nil { + var ret bool + return ret + } + return *o.TrackClicks +} + +// GetTrackClicksOk returns a tuple with the TrackClicks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmsUrlOptions) GetTrackClicksOk() (*bool, bool) { + if o == nil || o.TrackClicks == nil { + return nil, false + } + return o.TrackClicks, true +} + +// HasTrackClicks returns a boolean if a field has been set. +func (o *SmsUrlOptions) HasTrackClicks() bool { + if o != nil && o.TrackClicks != nil { + return true + } + + return false +} + +// SetTrackClicks gets a reference to the given bool and assigns it to the TrackClicks field. +func (o *SmsUrlOptions) SetTrackClicks(v bool) { + o.TrackClicks = &v +} + +// GetTrackingUrl returns the TrackingUrl field value if set, zero value otherwise. +func (o *SmsUrlOptions) GetTrackingUrl() string { + if o == nil || o.TrackingUrl == nil { + var ret string + return ret + } + return *o.TrackingUrl +} + +// GetTrackingUrlOk returns a tuple with the TrackingUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmsUrlOptions) GetTrackingUrlOk() (*string, bool) { + if o == nil || o.TrackingUrl == nil { + return nil, false + } + return o.TrackingUrl, true +} + +// HasTrackingUrl returns a boolean if a field has been set. +func (o *SmsUrlOptions) HasTrackingUrl() bool { + if o != nil && o.TrackingUrl != nil { + return true + } + + return false +} + +// SetTrackingUrl gets a reference to the given string and assigns it to the TrackingUrl field. +func (o *SmsUrlOptions) SetTrackingUrl(v string) { + o.TrackingUrl = &v +} + +// GetRemoveProtocol returns the RemoveProtocol field value if set, zero value otherwise. +func (o *SmsUrlOptions) GetRemoveProtocol() bool { + if o == nil || o.RemoveProtocol == nil { + var ret bool + return ret + } + return *o.RemoveProtocol +} + +// GetRemoveProtocolOk returns a tuple with the RemoveProtocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmsUrlOptions) GetRemoveProtocolOk() (*bool, bool) { + if o == nil || o.RemoveProtocol == nil { + return nil, false + } + return o.RemoveProtocol, true +} + +// HasRemoveProtocol returns a boolean if a field has been set. +func (o *SmsUrlOptions) HasRemoveProtocol() bool { + if o != nil && o.RemoveProtocol != nil { + return true + } + + return false +} + +// SetRemoveProtocol gets a reference to the given bool and assigns it to the RemoveProtocol field. +func (o *SmsUrlOptions) SetRemoveProtocol(v bool) { + o.RemoveProtocol = &v +} + +// GetCustomDomain returns the CustomDomain field value if set, zero value otherwise. +func (o *SmsUrlOptions) GetCustomDomain() string { + if o == nil || o.CustomDomain == nil { + var ret string + return ret + } + return *o.CustomDomain +} + +// GetCustomDomainOk returns a tuple with the CustomDomain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmsUrlOptions) GetCustomDomainOk() (*string, bool) { + if o == nil || o.CustomDomain == nil { + return nil, false + } + return o.CustomDomain, true +} + +// HasCustomDomain returns a boolean if a field has been set. +func (o *SmsUrlOptions) HasCustomDomain() bool { + if o != nil && o.CustomDomain != nil { + return true + } + + return false +} + +// SetCustomDomain gets a reference to the given string and assigns it to the CustomDomain field. +func (o *SmsUrlOptions) SetCustomDomain(v string) { + o.CustomDomain = &v +} + +func (o SmsUrlOptions) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ShortenUrl != nil { + toSerialize["shortenUrl"] = o.ShortenUrl + } + if o.TrackClicks != nil { + toSerialize["trackClicks"] = o.TrackClicks + } + if o.TrackingUrl != nil { + toSerialize["trackingUrl"] = o.TrackingUrl + } + if o.RemoveProtocol != nil { + toSerialize["removeProtocol"] = o.RemoveProtocol + } + if o.CustomDomain != nil { + toSerialize["customDomain"] = o.CustomDomain + } + return json.Marshal(toSerialize) +} + +type NullableSmsUrlOptions struct { + value *SmsUrlOptions + isSet bool +} + +func (v NullableSmsUrlOptions) Get() *SmsUrlOptions { + return v.value +} + +func (v *NullableSmsUrlOptions) Set(val *SmsUrlOptions) { + v.value = val + v.isSet = true +} + +func (v NullableSmsUrlOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableSmsUrlOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSmsUrlOptions(val *SmsUrlOptions) *NullableSmsUrlOptions { + return &NullableSmsUrlOptions{value: val, isSet: true} +} + +func (v NullableSmsUrlOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSmsUrlOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v2/model_tfa_api_exception.go b/v2/model_tfa_api_exception.go index 4fa2b83..0243a2e 100644 --- a/v2/model_tfa_api_exception.go +++ b/v2/model_tfa_api_exception.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ diff --git a/v2/model_tfa_api_request_error.go b/v2/model_tfa_api_request_error.go index faad6de..19fa16c 100644 --- a/v2/model_tfa_api_request_error.go +++ b/v2/model_tfa_api_request_error.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ diff --git a/v2/model_tfa_api_request_error_details.go b/v2/model_tfa_api_request_error_details.go index 8ab5835..e198530 100644 --- a/v2/model_tfa_api_request_error_details.go +++ b/v2/model_tfa_api_request_error_details.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ diff --git a/v2/model_tfa_application_configuration.go b/v2/model_tfa_application_configuration.go index d2f6bab..67b7199 100644 --- a/v2/model_tfa_application_configuration.go +++ b/v2/model_tfa_application_configuration.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -15,19 +14,19 @@ import ( "encoding/json" ) -// TfaApplicationConfiguration struct for TfaApplicationConfiguration +// TfaApplicationConfiguration Created 2FA application configuration. type TfaApplicationConfiguration struct { - // Tells if multiple PIN verifications are allowed. + // Indicates whether multiple PIN verification is allowed. AllowMultiplePinVerifications *bool `json:"allowMultiplePinVerifications,omitempty"` // Number of possible PIN attempts. PinAttempts *int32 `json:"pinAttempts,omitempty"` - // PIN time to live. Should be in format of `{timeLength}{timeUnit}`. Here `timeLength` is an optional positive integer with a default value of 1 and `timeUnit` is one of: `ms`, `s`, `m`, `h` or `d` representing milliseconds, seconds, minutes, hours and days respectively. Must not be larger that one year, although much lower values are recommended. + // Validity period of PIN in specified time unit. Required format: `{timeLength}{timeUnit}`. `timeLength` is optional with a default value of 1. `timeUnit` can be set to: `ms`, `s`, `m`, `h` or `d` representing milliseconds, seconds, minutes, hours, and days respectively. Must not exceed one year, although much lower value is recommended. PinTimeToLive *string `json:"pinTimeToLive,omitempty"` - // Overall number of requests in time interval for generating a PIN and sending an SMS using single application. Should be in format of `{attempts}/{timeLength}{timeUnit}`. Here `attempts` is a mandatory positive integer and `timeLength` is an optional positive integer with a default value of 1. `timeUnit` is one of: `ms`, `s`, `m`, `h` or `d` representing milliseconds, seconds, minutes, hours and days respectively. Time component must not be larger that one year, although much lower values are recommended. + // Overall number of requests over a specififed time period for generating a PIN and sending an SMS using a single application. Required format: `{attempts}/{timeLength}{timeUnit}`. `attempts` is mandatory and `timeLength` is optional with a default value of 1. `timeUnit` is one of: `ms`, `s`, `m`, `h` or `d` representing milliseconds, seconds, minutes, hours, and days respectively. Must not exceed one year, although much lower value is recommended. SendPinPerApplicationLimit *string `json:"sendPinPerApplicationLimit,omitempty"` - // Number of requests in time interval for generating a PIN and sending an SMS to one phone number (MSISDN). Should be in format of `{attempts}/{timeLength}{timeUnit}`. Here `attempts` is a mandatory positive integer and `timeLength` is an optional positive integer with a default value of 1. `timeUnit` is one of: `ms`, `s`, `m`, `h` or `d` representing milliseconds, seconds, minutes, hours and days respectively. Time component must not be larger that one year, although much lower values are recommended. + // Number of requests over a specififed time period for generating a PIN and sending an SMS to one phone number (MSISDN). Required format: `{attempts}/{timeLength}{timeUnit}`. `attempts` is mandatory and `timeLength` is optional with a default value of 1. `timeUnit` is one of: `ms`, `s`, `m`, `h` or `d` representing milliseconds, seconds, minutes, hours, and days respectively. Must not exceed one year, although much lower value is recommended. SendPinPerPhoneNumberLimit *string `json:"sendPinPerPhoneNumberLimit,omitempty"` - // Number of PIN verification requests in time interval from one phone number (MSISDN). Should be in format of `{attempts}/{timeLength}{timeUnit}`. Here `attempts` is a mandatory positive integer and `timeLength` is an optional positive integer with a default value of 1. `timeUnit` is one of: `ms`, `s`, `m`, `h` or `d` representing milliseconds, seconds, minutes, hours and days respectively. Time component must not be larger that one day, although much lower values are recommended. + // The number of PIN verification requests over a specififed time period from one phone number (MSISDN). Required format: `{attempts}/{timeLength}{timeUnit}`. `attempts` is mandatory and `timeLength` is optional with a default value of 1. `timeUnit` is one of: `ms`, `s`, `m`, `h` or `d` representing milliseconds, seconds, minutes, hours, and days respectively. Must not exceed one day, although much lower value is recommended. VerifyPinLimit *string `json:"verifyPinLimit,omitempty"` } diff --git a/v2/model_tfa_application_request.go b/v2/model_tfa_application_request.go index afa0ecd..20b2cda 100644 --- a/v2/model_tfa_application_request.go +++ b/v2/model_tfa_application_request.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,9 +16,8 @@ import ( // TfaApplicationRequest struct for TfaApplicationRequest type TfaApplicationRequest struct { - // Created 2FA application configuration. Configuration *TfaApplicationConfiguration `json:"configuration,omitempty"` - // Indicates if the created application is enabled. + // Indicates whether the created application is enabled. Enabled *bool `json:"enabled,omitempty"` // 2FA application name. Name string `json:"name"` diff --git a/v2/model_tfa_application_response.go b/v2/model_tfa_application_response.go index eeab160..9dbb7a9 100644 --- a/v2/model_tfa_application_response.go +++ b/v2/model_tfa_application_response.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,11 +16,10 @@ import ( // TfaApplicationResponse struct for TfaApplicationResponse type TfaApplicationResponse struct { - // 2FA application ID. - ApplicationId *string `json:"applicationId,omitempty"` - // Created 2FA application configuration. + // The ID of the application that represents your service, e.g. 2FA for login, 2FA for changing the password, etc. + ApplicationId *string `json:"applicationId,omitempty"` Configuration *TfaApplicationConfiguration `json:"configuration,omitempty"` - // Indicates if the created application is enabled. + // Indicates whether the created application is enabled. Enabled *bool `json:"enabled,omitempty"` // 2FA application name. Name *string `json:"name,omitempty"` diff --git a/v2/model_tfa_create_message_request.go b/v2/model_tfa_create_message_request.go index 2237aa5..a702d21 100644 --- a/v2/model_tfa_create_message_request.go +++ b/v2/model_tfa_create_message_request.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,21 +16,18 @@ import ( // TfaCreateMessageRequest struct for TfaCreateMessageRequest type TfaCreateMessageRequest struct { - // Language code of language in which message text is written. It is used for reading the message when it is sent via voice. If no language is set, message will be read in `English`. Language *TfaLanguage `json:"language,omitempty"` - // Text of a message that will be sent. It can contain placeholders that will be replaced upon sending. Placeholder format is `{{placeholderName}}`. Message text must contain `{{pin}}` placeholder. + // Content of the message being sent which contains at minimum one placeholder for a PIN code (`{{pin}}`). Placeholder format is `{{placeholderName}}`. MessageText string `json:"messageText"` // PIN code length. - PinLength *int32 `json:"pinLength,omitempty"` - // Type of PIN code that will be generated and sent as part of 2FA message. - PinType TfaPinType `json:"pinType"` - // Region specific parameters, often specified by local laws. Use this if country or region that you are sending SMS to requires some extra parameters. - Regional *TfaRegionalOptions `json:"regional,omitempty"` - // In case PIN message is sent by Voice, DTMF code will enable replaying the message. + PinLength *int32 `json:"pinLength,omitempty"` + PinType TfaPinType `json:"pinType"` + Regional *TfaRegionalOptions `json:"regional,omitempty"` + // If the PIN is sent as a voice message, the DTMF code allows the recipient to replay the message. RepeatDTMF *string `json:"repeatDTMF,omitempty"` // The name that will appear as the sender of the 2FA message (Example: CompanyName). SenderId *string `json:"senderId,omitempty"` - // In case PIN message is sent by Voice, the speed of speech can be set for the message. Supported range is from `0.5` to `2`. + // The speed of narration for messages sent as voice. Supported range is from `0.5` to `2`. SpeechRate *float64 `json:"speechRate,omitempty"` } diff --git a/v2/model_tfa_india_dlt_options.go b/v2/model_tfa_india_dlt_options.go index 63c9047..b5610de 100644 --- a/v2/model_tfa_india_dlt_options.go +++ b/v2/model_tfa_india_dlt_options.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -15,11 +14,11 @@ import ( "encoding/json" ) -// TfaIndiaDltOptions struct for TfaIndiaDltOptions +// TfaIndiaDltOptions Distributed Ledger Technology (DLT) specific parameters required for sending SMS to phone numbers registered in India. type TfaIndiaDltOptions struct { - // Id of your registered DTL content template that matches this message's text. + // Registered DLT content template ID which matches message you are sending. ContentTemplateId *string `json:"contentTemplateId,omitempty"` - // Your assigned DTL principal entity id. + // Your assigned DLT principal entity ID. PrincipalEntityId string `json:"principalEntityId"` } diff --git a/v2/model_tfa_language.go b/v2/model_tfa_language.go index 0694408..a73c837 100644 --- a/v2/model_tfa_language.go +++ b/v2/model_tfa_language.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -16,7 +15,7 @@ import ( "fmt" ) -// TfaLanguage the model 'TfaLanguage' +// TfaLanguage The language code which message is written in used when sending text-to-speech messages. If not defined, it will default to English (`en`). type TfaLanguage string // List of TfaLanguage @@ -36,6 +35,9 @@ const ( TFALANGUAGE_RU TfaLanguage = "ru" TFALANGUAGE_SV TfaLanguage = "sv" TFALANGUAGE_FI TfaLanguage = "fi" + TFALANGUAGE_HR TfaLanguage = "hr" + TFALANGUAGE_SL TfaLanguage = "sl" + TFALANGUAGE_RO TfaLanguage = "ro" TFALANGUAGE_PT_PT TfaLanguage = "pt-pt" TFALANGUAGE_PT_BR TfaLanguage = "pt-br" TFALANGUAGE_ZH_CN TfaLanguage = "zh-cn" @@ -49,7 +51,7 @@ func (v *TfaLanguage) UnmarshalJSON(src []byte) error { return err } enumTypeValue := TfaLanguage(value) - for _, existing := range []TfaLanguage{"en", "es", "ca", "da", "nl", "fr", "de", "it", "ja", "ko", "no", "pl", "ru", "sv", "fi", "pt-pt", "pt-br", "zh-cn", "zh-tw"} { + for _, existing := range []TfaLanguage{"en", "es", "ca", "da", "nl", "fr", "de", "it", "ja", "ko", "no", "pl", "ru", "sv", "fi", "hr", "sl", "ro", "pt-pt", "pt-br", "zh-cn", "zh-tw"} { if existing == enumTypeValue { *v = enumTypeValue return nil diff --git a/v2/model_tfa_message.go b/v2/model_tfa_message.go index 9bbdc4a..1ff9378 100644 --- a/v2/model_tfa_message.go +++ b/v2/model_tfa_message.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,22 +16,19 @@ import ( // TfaMessage struct for TfaMessage type TfaMessage struct { - // 2FA application ID for which the requested message is created. - ApplicationId *string `json:"applicationId,omitempty"` - // Language code of language in which message text is written. It is used for reading the message when it is sent via voice. If no language is set, message will be read in `English`. - Language *TfaLanguage `json:"language,omitempty"` - // Message template ID. + // The ID of the application that represents your service (e.g. 2FA for login, 2FA for changing the password, etc.) for which the requested message has been created. + ApplicationId *string `json:"applicationId,omitempty"` + Language *TfaLanguage `json:"language,omitempty"` + // The ID of the message template (message body with the PIN placeholder) that is sent to the recipient. MessageId *string `json:"messageId,omitempty"` // Text of a message that will be sent. Message text must contain `pinPlaceholder`. MessageText *string `json:"messageText,omitempty"` // PIN code length. PinLength *int32 `json:"pinLength,omitempty"` - // PIN code placeholder that will be replaced with generated PIN code. - PinPlaceholder *string `json:"pinPlaceholder,omitempty"` - // Type of PIN code that will be generated and sent as part of 2FA message. You can set PIN type to numeric, alpha, alphanumeric or hex. - PinType *TfaPinType `json:"pinType,omitempty"` - // Region specific parameters, often specified by local laws. Use this if country or region that you are sending SMS to requires some extra parameters. - Regional *TfaRegionalOptions `json:"regional,omitempty"` + // The PIN code placeholder that will be replaced with a generated PIN code. + PinPlaceholder *string `json:"pinPlaceholder,omitempty"` + PinType *TfaPinType `json:"pinType,omitempty"` + Regional *TfaRegionalOptions `json:"regional,omitempty"` // In case PIN message is sent by Voice, DTMF code will enable replaying the message. RepeatDTMF *string `json:"repeatDTMF,omitempty"` // The name that will appear as the sender of the 2FA message (Example: CompanyName). diff --git a/v2/model_tfa_pin_type.go b/v2/model_tfa_pin_type.go index df9845a..dc9321d 100644 --- a/v2/model_tfa_pin_type.go +++ b/v2/model_tfa_pin_type.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -16,7 +15,7 @@ import ( "fmt" ) -// TfaPinType the model 'TfaPinType' +// TfaPinType Type of PIN code that will be generated and sent as part of 2FA message. type TfaPinType string // List of TfaPinType diff --git a/v2/model_tfa_regional_options.go b/v2/model_tfa_regional_options.go index e8504e5..c8d86b0 100644 --- a/v2/model_tfa_regional_options.go +++ b/v2/model_tfa_regional_options.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -15,9 +14,8 @@ import ( "encoding/json" ) -// TfaRegionalOptions struct for TfaRegionalOptions +// TfaRegionalOptions Region-specific parameters, often imposed by local laws. Use this, if country or region that you are sending a message to requires additional information. type TfaRegionalOptions struct { - // Distributed Ledger Technology (DLT) specific parameters required for sending SMS to phone numbers registered in India. IndiaDlt *TfaIndiaDltOptions `json:"indiaDlt,omitempty"` } diff --git a/v2/model_tfa_resend_pin_request.go b/v2/model_tfa_resend_pin_request.go index f5f7930..de9c7e1 100644 --- a/v2/model_tfa_resend_pin_request.go +++ b/v2/model_tfa_resend_pin_request.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ diff --git a/v2/model_tfa_start_authentication_request.go b/v2/model_tfa_start_authentication_request.go index e48d758..6725194 100644 --- a/v2/model_tfa_start_authentication_request.go +++ b/v2/model_tfa_start_authentication_request.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,11 +16,11 @@ import ( // TfaStartAuthenticationRequest struct for TfaStartAuthenticationRequest type TfaStartAuthenticationRequest struct { - // 2FA application ID. + // The ID of the application that represents your service, e.g. 2FA for login, 2FA for changing the password, etc. ApplicationId string `json:"applicationId"` // Use this parameter if you wish to override the sender ID from the [created](#channels/sms/create-2fa-message-template) message template parameter `senderId`. From *string `json:"from,omitempty"` - // Message template ID that will be sent to phone number. + // The ID of the message template (message body with the PIN placeholder) that is sent to the recipient. MessageId string `json:"messageId"` // Key value pairs that will be replaced during message sending. Placeholder keys should NOT contain curly brackets and should NOT contain a `pin` placeholder. Valid example: `\"placeholders\":{\"firstName\":\"John\"}` Placeholders *map[string]string `json:"placeholders,omitempty"` diff --git a/v2/model_tfa_start_authentication_response.go b/v2/model_tfa_start_authentication_response.go index f189bf6..41a15a0 100644 --- a/v2/model_tfa_start_authentication_response.go +++ b/v2/model_tfa_start_authentication_response.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,9 +16,9 @@ import ( // TfaStartAuthenticationResponse struct for TfaStartAuthenticationResponse type TfaStartAuthenticationResponse struct { - // Call status. + // Call status, e.g. `PENDING_ACCEPTED`. CallStatus *string `json:"callStatus,omitempty"` - // Status of sent Number Lookup. Number Lookup status can have one of the following values: `NC_DESTINATION_UNKNOWN`, `NC_DESTINATION_REACHABLE`, `NC_DESTINATION_NOT_REACHABLE`, `NC_NOT_CONFIGURED`. If you get the `NC_NOT_CONFIGURED` status, you should contact your Account Manager. SMS will not be sent only if Number Lookup status is `NC_NOT_REACHABLE`. + // Status of sent [Number Lookup](https://www.infobip.com/docs/number-lookup). Number Lookup status can have one of the following values: `NC_DESTINATION_UNKNOWN`, `NC_DESTINATION_REACHABLE`, `NC_DESTINATION_NOT_REACHABLE`, `NC_NOT_CONFIGURED`. Contact your Account Manager, if you get the `NC_NOT_CONFIGURED` status. SMS will not be sent only if Number Lookup status is `NC_NOT_REACHABLE`. NcStatus *string `json:"ncStatus,omitempty"` // Sent PIN code ID. PinId *string `json:"pinId,omitempty"` diff --git a/v2/model_tfa_update_message_request.go b/v2/model_tfa_update_message_request.go index 3b30261..f54ad48 100644 --- a/v2/model_tfa_update_message_request.go +++ b/v2/model_tfa_update_message_request.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,21 +16,18 @@ import ( // TfaUpdateMessageRequest struct for TfaUpdateMessageRequest type TfaUpdateMessageRequest struct { - // Language code of language in which message text is written. It is used for reading the message when it is sent via voice. If no language is set, message will be read in `English`. Language *TfaLanguage `json:"language,omitempty"` - // Text of a message that will be sent. Message text must contain `pinPlaceholder`. + // Content of the message being sent which contains at minimum one placeholder for a PIN code (`{{pin}}`). Placeholder format is `{{placeholderName}}`. MessageText *string `json:"messageText,omitempty"` // PIN code length. - PinLength *int32 `json:"pinLength,omitempty"` - // Type of PIN code that will be generated and sent as part of 2FA message. You can set PIN type to numeric, alpha, alphanumeric or hex. - PinType *TfaPinType `json:"pinType,omitempty"` - // Region specific parameters, often specified by local laws. Use this if country or region that you are sending SMS to requires some extra parameters. - Regional *TfaRegionalOptions `json:"regional,omitempty"` - // In case PIN message is sent by Voice, DTMF code will enable replaying the message. + PinLength *int32 `json:"pinLength,omitempty"` + PinType *TfaPinType `json:"pinType,omitempty"` + Regional *TfaRegionalOptions `json:"regional,omitempty"` + // If the PIN is sent as a voice message, the DTMF code allows the recipient to replay the message. RepeatDTMF *string `json:"repeatDTMF,omitempty"` - // The name that will appear as the sender of the 2FA message (Example: CompanyName). + // The name that will appear as the sender of the 2FA message (e.g. CompanyName). SenderId *string `json:"senderId,omitempty"` - // In case PIN message is sent by Voice, the speed of speech can be set for the message. Supported range is from `0.5` to `2`. + // The speed of narration for messages sent as voice. Supported range is from `0.5` to `2`. SpeechRate *float64 `json:"speechRate,omitempty"` } diff --git a/v2/model_tfa_verification.go b/v2/model_tfa_verification.go index 484beaa..9e616e1 100644 --- a/v2/model_tfa_verification.go +++ b/v2/model_tfa_verification.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ diff --git a/v2/model_tfa_verification_response.go b/v2/model_tfa_verification_response.go index e4f9f97..c12bc71 100644 --- a/v2/model_tfa_verification_response.go +++ b/v2/model_tfa_verification_response.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ diff --git a/v2/model_tfa_verify_pin_request.go b/v2/model_tfa_verify_pin_request.go index 6beab4a..a314751 100644 --- a/v2/model_tfa_verify_pin_request.go +++ b/v2/model_tfa_verify_pin_request.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -17,7 +16,7 @@ import ( // TfaVerifyPinRequest struct for TfaVerifyPinRequest type TfaVerifyPinRequest struct { - // PIN code to verify + // The PIN code to verify. Pin string `json:"pin"` } diff --git a/v2/model_tfa_verify_pin_response.go b/v2/model_tfa_verify_pin_response.go index 4fd59a0..3dfce8d 100644 --- a/v2/model_tfa_verify_pin_response.go +++ b/v2/model_tfa_verify_pin_response.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ @@ -21,11 +20,11 @@ type TfaVerifyPinResponse struct { AttemptsRemaining *int32 `json:"attemptsRemaining,omitempty"` // Phone number (`MSISDN`) to which the 2FA message was sent. Msisdn *string `json:"msisdn,omitempty"` - // Indicates if any error occurs during PIN verification. + // Indicates whether an error has occurred during PIN verification. PinError *string `json:"pinError,omitempty"` // Sent PIN code ID. PinId *string `json:"pinId,omitempty"` - // Indicates if the phone number (`MSISDN`) was successfully verified. + // Indicates whether the phone number (`MSISDN`) was successfully verified. Verified *bool `json:"verified,omitempty"` } diff --git a/v2/response.go b/v2/response.go index 4a4c59f..5b6709b 100644 --- a/v2/response.go +++ b/v2/response.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ diff --git a/v2/time.go b/v2/time.go index 689e54c..ecc4b4a 100644 --- a/v2/time.go +++ b/v2/time.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */ diff --git a/v2/utils.go b/v2/utils.go index 21d2ed8..e4e5a67 100644 --- a/v2/utils.go +++ b/v2/utils.go @@ -3,7 +3,6 @@ * * OpenAPI specification containing public endpoints supported in client API libraries. * - * API version: 1.0.157 * Contact: support@infobip.com */