Skip to content

Release 3.3.0 #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
push:
tags:
- *
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/}" >> $GITHUB_ENV
- name: Build
run: dotnet build -c Release
- name: Pack
run: dotnet pack ./src/com.Messente.Api/com.Messente.Api.csproj -o out -c Release --no-build
- name: Push
run: dotnet nuget push out/com.Messente.Api.${VERSION}.nupkg -k ${NUGET_TOKEN} -s https://api.nuget.org/v3/index.json
env:
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ docs/WhatsAppLanguage.md
docs/WhatsAppMedia.md
docs/WhatsAppParameter.md
docs/WhatsAppTemplate.md
docs/WhatsAppText.md
git_push.sh
src/com.Messente.Api/Api/BlacklistApi.cs
src/com.Messente.Api/Api/BulkMessagingApi.cs
Expand Down Expand Up @@ -156,4 +157,5 @@ src/com.Messente.Api/Model/WhatsAppLanguage.cs
src/com.Messente.Api/Model/WhatsAppMedia.cs
src/com.Messente.Api/Model/WhatsAppParameter.cs
src/com.Messente.Api/Model/WhatsAppTemplate.cs
src/com.Messente.Api/Model/WhatsAppText.cs
src/com.Messente.Api/com.Messente.Api.csproj
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Messente API Library

- Messente API version: 2.0.0
- C# package version: 3.2.0
- C# package version: 3.3.0

[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.

Expand All @@ -11,11 +11,11 @@ Install Messente API library via NuGet Package Manager or .NET CLI.

### Package Manager

`Install-Package com.Messente.Api -Version 3.2.0`
`Install-Package com.Messente.Api -Version 3.3.0`

### .NET CLI

`dotnet add package com.Messente.Api --version 3.2.0`
`dotnet add package com.Messente.Api --version 3.3.0`

## Features

Expand Down
22 changes: 22 additions & 0 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2163,6 +2163,8 @@ components:
type: integer
template:
$ref: '#/components/schemas/WhatsAppTemplate'
text:
$ref: '#/components/schemas/WhatsAppText'
channel:
default: whatsapp
description: The channel used to deliver the message
Expand Down Expand Up @@ -2363,9 +2365,29 @@ components:
$ref: '#/components/schemas/WhatsAppMedia'
video:
$ref: '#/components/schemas/WhatsAppMedia'
coupon_code:
description: A coupon code.
type: string
payload:
description: A payload.
type: string
required:
- type
type: object
WhatsAppText:
description: A text
properties:
preview_url:
default: true
description: Whether to display link preview if the message contains a hyperlink
type: boolean
body:
description: "Plaintext content for WhatsApp, can contain URLs, emojis and\
\ formatting"
type: string
required:
- body
type: object
ErrorCodeOmnichannel:
description: |-
Matches the following error title.
Expand Down
1 change: 1 addition & 0 deletions docs/WhatsApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Name | Type | Description | Notes
**Validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional]
**Ttl** | **int** | After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. | [optional]
**Template** | [**WhatsAppTemplate**](WhatsAppTemplate.md) | | [optional]
**Text** | [**WhatsAppText**](WhatsAppText.md) | | [optional]
**Channel** | **string** | The channel used to deliver the message | [optional] [default to ChannelEnum.Whatsapp]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
2 changes: 2 additions & 0 deletions docs/WhatsAppParameter.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Name | Type | Description | Notes
**Image** | [**WhatsAppMedia**](WhatsAppMedia.md) | | [optional]
**Document** | [**WhatsAppMedia**](WhatsAppMedia.md) | | [optional]
**Video** | [**WhatsAppMedia**](WhatsAppMedia.md) | | [optional]
**CouponCode** | **string** | A coupon code. | [optional]
**Payload** | **string** | A payload. | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

12 changes: 12 additions & 0 deletions docs/WhatsAppText.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# com.Messente.Api.Model.WhatsAppText
A text

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**PreviewUrl** | **bool** | Whether to display link preview if the message contains a hyperlink | [optional] [default to true]
**Body** | **string** | Plaintext content for WhatsApp, can contain URLs, emojis and formatting |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

6 changes: 3 additions & 3 deletions src/com.Messente.Api/Client/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class Configuration : IReadableConfiguration
/// Version of the package.
/// </summary>
/// <value>Version of the package.</value>
public const string Version = "3.2.0";
public const string Version = "3.3.0";

/// <summary>
/// Identifier for ISO 8601 DateTime Format
Expand Down Expand Up @@ -118,7 +118,7 @@ public class Configuration : IReadableConfiguration
public Configuration()
{
Proxy = null;
UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/3.2.0/csharp");
UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/3.3.0/csharp");
BasePath = "https://api.messente.com/v1";
DefaultHeaders = new ConcurrentDictionary<string, string>();
ApiKey = new ConcurrentDictionary<string, string>();
Expand Down Expand Up @@ -541,7 +541,7 @@ public static string ToDebugReport()
report += " OS: " + System.Environment.OSVersion + "\n";
report += " .NET Framework Version: " + System.Environment.Version + "\n";
report += " Version of the API: 2.0.0\n";
report += " SDK Package Version: 3.2.0\n";
report += " SDK Package Version: 3.3.0\n";

return report;
}
Expand Down
11 changes: 10 additions & 1 deletion src/com.Messente.Api/Model/WhatsApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ public enum ChannelEnum
/// <param name="validity">After how many minutes this channel is considered as failed and the next channel is attempted.</param>
/// <param name="ttl">After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \&quot;ttl\&quot; and \&quot;validity\&quot; can be used..</param>
/// <param name="template">template.</param>
/// <param name="text">text.</param>
/// <param name="channel">The channel used to deliver the message (default to ChannelEnum.Whatsapp).</param>
public WhatsApp(string sender = default(string), int validity = default(int), int ttl = default(int), WhatsAppTemplate template = default(WhatsAppTemplate), ChannelEnum? channel = ChannelEnum.Whatsapp)
public WhatsApp(string sender = default(string), int validity = default(int), int ttl = default(int), WhatsAppTemplate template = default(WhatsAppTemplate), WhatsAppText text = default(WhatsAppText), ChannelEnum? channel = ChannelEnum.Whatsapp)
{
this.Sender = sender;
this.Validity = validity;
this.Ttl = ttl;
this.Template = template;
this.Text = text;
this.Channel = channel;
this.AdditionalProperties = new Dictionary<string, object>();
}
Expand Down Expand Up @@ -100,6 +102,12 @@ public enum ChannelEnum
[DataMember(Name = "template", EmitDefaultValue = false)]
public WhatsAppTemplate Template { get; set; }

/// <summary>
/// Gets or Sets Text
/// </summary>
[DataMember(Name = "text", EmitDefaultValue = false)]
public WhatsAppText Text { get; set; }

/// <summary>
/// Gets or Sets additional properties
/// </summary>
Expand All @@ -118,6 +126,7 @@ public override string ToString()
sb.Append(" Validity: ").Append(Validity).Append("\n");
sb.Append(" Ttl: ").Append(Ttl).Append("\n");
sb.Append(" Template: ").Append(Template).Append("\n");
sb.Append(" Text: ").Append(Text).Append("\n");
sb.Append(" Channel: ").Append(Channel).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
Expand Down
22 changes: 21 additions & 1 deletion src/com.Messente.Api/Model/WhatsAppParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ protected WhatsAppParameter()
/// <param name="image">image.</param>
/// <param name="document">document.</param>
/// <param name="video">video.</param>
public WhatsAppParameter(string type = default(string), string text = default(string), WhatsAppCurrency currency = default(WhatsAppCurrency), WhatsAppDatetime dateTime = default(WhatsAppDatetime), WhatsAppMedia image = default(WhatsAppMedia), WhatsAppMedia document = default(WhatsAppMedia), WhatsAppMedia video = default(WhatsAppMedia))
/// <param name="couponCode">A coupon code..</param>
/// <param name="payload">A payload..</param>
public WhatsAppParameter(string type = default(string), string text = default(string), WhatsAppCurrency currency = default(WhatsAppCurrency), WhatsAppDatetime dateTime = default(WhatsAppDatetime), WhatsAppMedia image = default(WhatsAppMedia), WhatsAppMedia document = default(WhatsAppMedia), WhatsAppMedia video = default(WhatsAppMedia), string couponCode = default(string), string payload = default(string))
{
// to ensure "type" is required (not null)
if (type == null)
Expand All @@ -64,6 +66,8 @@ protected WhatsAppParameter()
this.Image = image;
this.Document = document;
this.Video = video;
this.CouponCode = couponCode;
this.Payload = payload;
this.AdditionalProperties = new Dictionary<string, object>();
}

Expand Down Expand Up @@ -111,6 +115,20 @@ protected WhatsAppParameter()
[DataMember(Name = "video", EmitDefaultValue = false)]
public WhatsAppMedia Video { get; set; }

/// <summary>
/// A coupon code.
/// </summary>
/// <value>A coupon code.</value>
[DataMember(Name = "coupon_code", EmitDefaultValue = false)]
public string CouponCode { get; set; }

/// <summary>
/// A payload.
/// </summary>
/// <value>A payload.</value>
[DataMember(Name = "payload", EmitDefaultValue = false)]
public string Payload { get; set; }

/// <summary>
/// Gets or Sets additional properties
/// </summary>
Expand All @@ -132,6 +150,8 @@ public override string ToString()
sb.Append(" Image: ").Append(Image).Append("\n");
sb.Append(" Document: ").Append(Document).Append("\n");
sb.Append(" Video: ").Append(Video).Append("\n");
sb.Append(" CouponCode: ").Append(CouponCode).Append("\n");
sb.Append(" Payload: ").Append(Payload).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
Expand Down
115 changes: 115 additions & 0 deletions src/com.Messente.Api/Model/WhatsAppText.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/*
* Messente API
*
* [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
*
* The version of the OpenAPI document: 2.0.0
* Contact: [email protected]
* Generated by: https://github.com/openapitools/openapi-generator.git
*/


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = com.Messente.Api.Client.OpenAPIDateConverter;

namespace com.Messente.Api.Model
{
/// <summary>
/// A text
/// </summary>
[DataContract(Name = "WhatsAppText")]
public partial class WhatsAppText : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="WhatsAppText" /> class.
/// </summary>
[JsonConstructorAttribute]
protected WhatsAppText()
{
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
/// Initializes a new instance of the <see cref="WhatsAppText" /> class.
/// </summary>
/// <param name="previewUrl">Whether to display link preview if the message contains a hyperlink (default to true).</param>
/// <param name="body">Plaintext content for WhatsApp, can contain URLs, emojis and formatting (required).</param>
public WhatsAppText(bool previewUrl = true, string body = default(string))
{
// to ensure "body" is required (not null)
if (body == null)
{
throw new ArgumentNullException("body is a required property for WhatsAppText and cannot be null");
}
this.Body = body;
this.PreviewUrl = previewUrl;
this.AdditionalProperties = new Dictionary<string, object>();
}

/// <summary>
/// Whether to display link preview if the message contains a hyperlink
/// </summary>
/// <value>Whether to display link preview if the message contains a hyperlink</value>
[DataMember(Name = "preview_url", EmitDefaultValue = true)]
public bool PreviewUrl { get; set; }

/// <summary>
/// Plaintext content for WhatsApp, can contain URLs, emojis and formatting
/// </summary>
/// <value>Plaintext content for WhatsApp, can contain URLs, emojis and formatting</value>
[DataMember(Name = "body", IsRequired = true, EmitDefaultValue = true)]
public string Body { get; set; }

/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class WhatsAppText {\n");
sb.Append(" PreviewUrl: ").Append(PreviewUrl).Append("\n");
sb.Append(" Body: ").Append(Body).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}

/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}

}
2 changes: 1 addition & 1 deletion src/com.Messente.Api/com.Messente.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<Description>Send and receive SMS, Viber, Telegram and WhatsApp messages, blacklist phone numbers to make sure you&#39;re not sending any unwanted messages, manage contacts and groups.</Description>
<Copyright>Messente</Copyright>
<RootNamespace>com.Messente.Api</RootNamespace>
<Version>3.2.0</Version>
<Version>3.3.0</Version>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\com.Messente.Api.xml</DocumentationFile>
<RepositoryUrl>https://github.com/GIT_USER_ID/GIT_REPO_ID.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand Down
Loading