Skip to content
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

refactor: align method signatures for async/sync methods on AccountsClient #516

Merged
merged 1 commit into from
Sep 18, 2023
Merged
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
10 changes: 5 additions & 5 deletions Vonage/Accounts/AccountClient.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using System;
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Vonage.Request;

namespace Vonage.Accounts;

public class AccountClient : IAccountClient

Check warning on line 8 in Vonage/Accounts/AccountClient.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'AccountClient'
{
public Credentials Credentials { get; set; }

Check warning on line 10 in Vonage/Accounts/AccountClient.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'AccountClient.Credentials'

public AccountClient(Credentials creds = null) => this.Credentials = creds;

Check warning on line 12 in Vonage/Accounts/AccountClient.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'AccountClient.AccountClient(Credentials)'

public AccountSettingsResult ChangeAccountSettings(AccountSettingsRequest request, Credentials creds = null) =>
new ApiRequest(creds ?? this.Credentials).DoPostRequestUrlContentFromObject<AccountSettingsResult>
Expand All @@ -34,7 +34,7 @@
AuthType.Basic
);

public Task<Secret> CreateApiSecretAsync(CreateSecretRequest request, string apiKey, Credentials creds = null) =>
public Task<Secret> CreateApiSecretAsync(CreateSecretRequest request, string apiKey = null, Credentials creds = null) =>
new ApiRequest(creds ?? this.Credentials).DoRequestWithJsonContentAsync<Secret>(
HttpMethod.Post,
ApiRequest.GetBaseUri(ApiRequest.UriType.Api, $"/accounts/{apiKey}/secrets"),
Expand Down Expand Up @@ -86,7 +86,7 @@
AuthType.Basic
);

public Task<Secret> RetrieveApiSecretAsync(string secretId, string apiKey, Credentials creds = null) =>
public Task<Secret> RetrieveApiSecretAsync(string secretId, string apiKey = null, Credentials creds = null) =>
new ApiRequest(creds ?? this.Credentials).DoGetRequestWithQueryParametersAsync<Secret>(
ApiRequest.GetBaseUri(ApiRequest.UriType.Api, $"/accounts/{apiKey}/secrets/{secretId}"),
AuthType.Basic
Expand All @@ -98,7 +98,7 @@
AuthType.Basic
);

public Task<SecretsRequestResult> RetrieveApiSecretsAsync(string apiKey, Credentials creds = null) =>
public Task<SecretsRequestResult> RetrieveApiSecretsAsync(string apiKey = null, Credentials creds = null) =>
new ApiRequest(creds ?? this.Credentials).DoGetRequestWithQueryParametersAsync<SecretsRequestResult>(
ApiRequest.GetBaseUri(ApiRequest.UriType.Api, $"/accounts/{apiKey}/secrets"),
AuthType.Basic
Expand Down Expand Up @@ -137,7 +137,7 @@
return true;
}

public async Task<bool> RevokeApiSecretAsync(string secretId, string apiKey, Credentials creds = null)
public async Task<bool> RevokeApiSecretAsync(string secretId, string apiKey = null, Credentials creds = null)
{
await new ApiRequest(creds ?? this.Credentials).DoDeleteRequestWithUrlContentAsync(
ApiRequest.GetBaseUri(ApiRequest.UriType.Api, $"/accounts/{apiKey}/secrets/{secretId}"),
Expand Down
Loading