Skip to content

Commit

Permalink
fix: update casing for some mounts and properties in node-oai (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
childish-sambino authored Nov 3, 2022
1 parent 2cf4a1c commit b39d362
Show file tree
Hide file tree
Showing 14 changed files with 187 additions and 148 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ public class CreateNewCredentialsOptions : IOptions<NewCredentialsResource>
///<summary> A comma-separated list of the permissions you will request from the users of this ConnectApp. Can include: `get-all` and `post-all`. </summary>
public List<NewCredentialsResource.PermissionsEnum> Permissions { get; set; }


public string SomeA2PThing { get; set; }


/// <summary> Construct a new CreateCredentialAwsOptions </summary>
/// <param name="testString"> </param>
Expand Down Expand Up @@ -149,6 +152,10 @@ public List<KeyValuePair<string, string>> GetParams()
{
p.AddRange(Permissions.Select(Permissions => new KeyValuePair<string, string>("Permissions", Permissions.ToString())));
}
if (SomeA2PThing != null)
{
p.Add(new KeyValuePair<string, string>("SomeA2PThing", SomeA2PThing));
}
return p;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public static async System.Threading.Tasks.Task<NewCredentialsResource> CreateAs
/// <param name="testObjectArray"> </param>
/// <param name="testAnyType"> </param>
/// <param name="permissions"> A comma-separated list of the permissions you will request from the users of this ConnectApp. Can include: `get-all` and `post-all`. </param>
/// <param name="someA2PThing"> </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> A single instance of NewCredentials </returns>
public static NewCredentialsResource Create(
Expand All @@ -134,9 +135,10 @@ public static NewCredentialsResource Create(
List<object> testObjectArray = null,
object testAnyType = null,
List<NewCredentialsResource.PermissionsEnum> permissions = null,
string someA2PThing = null,
ITwilioRestClient client = null)
{
var options = new CreateNewCredentialsOptions(testString){ TestInteger = testInteger, TestDate = testDate, TestNumberFloat = testNumberFloat, TestObject = testObject, TestBoolean = testBoolean, TestNumber = testNumber, TestNumberDouble = testNumberDouble, TestNumberInt32 = testNumberInt32, TestNumberInt64 = testNumberInt64, TestDateTime = testDateTime, TestEnum = testEnum, TestObjectArray = testObjectArray, TestAnyType = testAnyType, Permissions = permissions };
var options = new CreateNewCredentialsOptions(testString){ TestInteger = testInteger, TestDate = testDate, TestNumberFloat = testNumberFloat, TestObject = testObject, TestBoolean = testBoolean, TestNumber = testNumber, TestNumberDouble = testNumberDouble, TestNumberInt32 = testNumberInt32, TestNumberInt64 = testNumberInt64, TestDateTime = testDateTime, TestEnum = testEnum, TestObjectArray = testObjectArray, TestAnyType = testAnyType, Permissions = permissions, SomeA2PThing = someA2PThing };
return Create(options, client);
}

Expand All @@ -157,6 +159,7 @@ public static NewCredentialsResource Create(
/// <param name="testObjectArray"> </param>
/// <param name="testAnyType"> </param>
/// <param name="permissions"> A comma-separated list of the permissions you will request from the users of this ConnectApp. Can include: `get-all` and `post-all`. </param>
/// <param name="someA2PThing"> </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> Task that resolves to A single instance of NewCredentials </returns>
public static async System.Threading.Tasks.Task<NewCredentialsResource> CreateAsync(
Expand All @@ -175,9 +178,10 @@ public static async System.Threading.Tasks.Task<NewCredentialsResource> CreateAs
List<object> testObjectArray = null,
object testAnyType = null,
List<NewCredentialsResource.PermissionsEnum> permissions = null,
string someA2PThing = null,
ITwilioRestClient client = null)
{
var options = new CreateNewCredentialsOptions(testString){ TestInteger = testInteger, TestDate = testDate, TestNumberFloat = testNumberFloat, TestObject = testObject, TestBoolean = testBoolean, TestNumber = testNumber, TestNumberDouble = testNumberDouble, TestNumberInt32 = testNumberInt32, TestNumberInt64 = testNumberInt64, TestDateTime = testDateTime, TestEnum = testEnum, TestObjectArray = testObjectArray, TestAnyType = testAnyType, Permissions = permissions };
var options = new CreateNewCredentialsOptions(testString){ TestInteger = testInteger, TestDate = testDate, TestNumberFloat = testNumberFloat, TestObject = testObject, TestBoolean = testBoolean, TestNumber = testNumber, TestNumberDouble = testNumberDouble, TestNumberInt32 = testNumberInt32, TestNumberInt64 = testNumberInt64, TestDateTime = testDateTime, TestEnum = testEnum, TestObjectArray = testObjectArray, TestAnyType = testAnyType, Permissions = permissions, SomeA2PThing = someA2PThing };
return await CreateAsync(options, client);
}
#endif
Expand Down
9 changes: 9 additions & 0 deletions examples/go/go-client/helper/rest/flex/v1/credentials_aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ type CreateCredentialAwsParams struct {
TestAnyType *interface{} `json:"TestAnyType,omitempty"`
// A comma-separated list of the permissions you will request from the users of this ConnectApp. Can include: `get-all` and `post-all`.
Permissions *[]string `json:"Permissions,omitempty"`
//
SomeA2PThing *string `json:"SomeA2PThing,omitempty"`
}

func (params *CreateCredentialAwsParams) SetTestString(TestString string) *CreateCredentialAwsParams {
Expand Down Expand Up @@ -118,6 +120,10 @@ func (params *CreateCredentialAwsParams) SetPermissions(Permissions []string) *C
params.Permissions = &Permissions
return params
}
func (params *CreateCredentialAwsParams) SetSomeA2PThing(SomeA2PThing string) *CreateCredentialAwsParams {
params.SomeA2PThing = &SomeA2PThing
return params
}

func (c *ApiService) CreateCredentialAws(params *CreateCredentialAwsParams) (*TestResponseObject, error) {
path := "/v1/Credentials/AWS"
Expand Down Expand Up @@ -192,6 +198,9 @@ func (c *ApiService) CreateCredentialAws(params *CreateCredentialAwsParams) (*Te
data.Add("Permissions", item)
}
}
if params != nil && params.SomeA2PThing != nil {
data.Set("SomeA2PThing", *params.SomeA2PThing)
}

resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ Name | Type | Requirement | Description
**test_object_array** | list(string) | Optional |
**test_any_type** | string | Optional |
**permissions** | list(string) | Optional | A comma-separated list of the permissions you will request from the users of this ConnectApp. Can include: &#x60;get-all&#x60; and &#x60;post-all&#x60;.
**some_a2_pthing** | string | Optional |
**sid** | string | *Computed* |

Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func ResourceCredentialsAWS() *schema.Resource {
"test_object_array": AsList(AsString(SchemaForceNewOptional), SchemaForceNewOptional),
"test_any_type": AsString(SchemaForceNewOptional),
"permissions": AsList(AsString(SchemaForceNewOptional), SchemaForceNewOptional),
"some_a2_pthing": AsString(SchemaForceNewOptional),
"sid": AsString(SchemaComputed),
},
Importer: &schema.ResourceImporter{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public class NewCredentialsCreator extends Creator<NewCredentials>{
private List<Map<String, Object>> testObjectArray;
private Map<String, Object> testAnyType;
private List<NewCredentials.Permissions> permissions;
private String someA2PThing;

public NewCredentialsCreator(final String testString, final Integer testInteger, final Float testNumberFloat) {
this.testString = testString;
Expand Down Expand Up @@ -153,6 +154,10 @@ public NewCredentialsCreator setPermissions(final List<NewCredentials.Permission
public NewCredentialsCreator setPermissions(final NewCredentials.Permissions permissions){
return setPermissions(Promoter.listOfOne(permissions));
}
public NewCredentialsCreator setSomeA2PThing(final String someA2PThing){
this.someA2PThing = someA2PThing;
return this;
}

@Override
public NewCredentials create(final TwilioRestClient client){
Expand Down Expand Up @@ -244,5 +249,9 @@ private void addPostParams(final Request request) {
}

}
if (someA2PThing != null) {
request.addPostParam("SomeA2PThing", someA2PThing);

}
}
}
8 changes: 4 additions & 4 deletions examples/node/lib/rest/flexApi/v1/credential.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import { inspect, InspectOptions } from "util";
import V1 from "../V1";
const deserialize = require("../../../base/deserialize");
const serialize = require("../../../base/serialize");
import { AWSListInstance } from "./credential/aws";
import { AwsListInstance } from "./credential/aws";
import { NewCredentialsListInstance } from "./credential/newCredentials";

export interface CredentialListInstance {
aws: AWSListInstance;
aws: AwsListInstance;
newCredentials: NewCredentialsListInstance;

/**
Expand All @@ -38,7 +38,7 @@ class CredentialListInstanceImpl implements CredentialListInstance {
_solution?: CredentialSolution;
_uri?: string;

_aws?: AWSListInstance;
_aws?: AwsListInstance;
_newCredentials?: NewCredentialsListInstance;
}

Expand All @@ -52,7 +52,7 @@ export function CredentialListInstance(version: V1): CredentialListInstance {
Object.defineProperty(instance, "aws", {
get: function aws() {
if (!this._aws) {
this._aws = AWSListInstance(this._version);
this._aws = AwsListInstance(this._version);
}
return this._aws;
},
Expand Down
Loading

0 comments on commit b39d362

Please sign in to comment.