Skip to content

Commit

Permalink
Support a hidden feature of fax sending
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerlong committed Dec 31, 2019
1 parent baeec2b commit ba274ca
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 6 deletions.
2 changes: 1 addition & 1 deletion RingCentral.Net/Definitions/CreateFaxMessageRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class CreateFaxMessageRequest
/// <summary>
/// To Phone Number
/// </summary>
public MessageStoreCallerInfoRequest[] to;
public MessageStoreCalleeInfoRequest[] to;

/// <summary>
/// Timestamp to send fax at. If not specified (current or the past), the fax is sent immediately
Expand Down
15 changes: 15 additions & 0 deletions RingCentral.Net/Definitions/MessageStoreCalleeInfoRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace RingCentral
{
public class MessageStoreCalleeInfoRequest
{
/// <summary>
/// Phone number in E.164 format
/// </summary>
public string phoneNumber;

/// <summary>
/// Name of the callee
/// </summary>
public string name;
}
}
7 changes: 4 additions & 3 deletions RingCentral.Tests/FaxTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ await rc.Authorize(
{
to = new[]
{
new MessageStoreCallerInfoRequest
new MessageStoreCalleeInfoRequest
{
phoneNumber = Environment.GetEnvironmentVariable("RINGCENTRAL_RECEIVER")
name = "The Receiver"
}
},
attachments = new[]
Expand Down Expand Up @@ -78,7 +79,7 @@ await rc.Authorize(
{
to = new[]
{
new MessageStoreCallerInfoRequest
new MessageStoreCalleeInfoRequest
{
phoneNumber = Environment.GetEnvironmentVariable("RINGCENTRAL_RECEIVER")
}
Expand Down Expand Up @@ -126,7 +127,7 @@ await rc.Authorize(
{
to = new[]
{
new MessageStoreCallerInfoRequest
new MessageStoreCalleeInfoRequest
{
phoneNumber = Environment.GetEnvironmentVariable("RINGCENTRAL_RECEIVER")
}
Expand Down
18 changes: 17 additions & 1 deletion code-generator/adjust.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,23 @@ faxAttachment.name = 'attachments'
const faxTo = sendFaxParams.filter(p => p.name === 'to')[0]
if (faxTo.items.type === 'string') {
delete faxTo.items.type
faxTo.items.$ref = '#/definitions/MessageStoreCallerInfoRequest'
faxTo.items.$ref = '#/definitions/MessageStoreCalleeInfoRequest'
}

// https://jira.ringcentral.com/browse/PLD-337?filter=-2
// https://github.com/ringcentral/RingCentral.Net/issues/12
doc.definitions.MessageStoreCalleeInfoRequest = {
type: 'object',
properties: {
phoneNumber: {
type: 'string',
description: 'Phone number in E.164 format'
},
name: {
type: 'string',
description: 'Name of the callee'
}
}
}

// https://git.ringcentral.com/platform/api-metadata-specs/issues/48
Expand Down
11 changes: 10 additions & 1 deletion code-generator/rc-platform-adjusted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,7 @@ paths:
required: true
type: array
items:
$ref: '#/definitions/MessageStoreCallerInfoRequest'
$ref: '#/definitions/MessageStoreCalleeInfoRequest'
- name: sendTime
in: formData
description: >-
Expand Down Expand Up @@ -30018,6 +30018,15 @@ definitions:
example: 8zXq6oaLT7WvwWITlGiA1A
id_token:
type: string
MessageStoreCalleeInfoRequest:
type: object
properties:
phoneNumber:
type: string
description: Phone number in E.164 format
name:
type: string
description: Name of the callee
CustomGreetingAnsweringRuleInfoRequest: &ref_2
type: object
properties:
Expand Down

0 comments on commit ba274ca

Please sign in to comment.