Refinitiv.EDP.AutoRest.Auth.CloudCredentials 1.0.0

The source code is generated by AutoRest.

Install-Package Refinitiv.EDP.AutoRest.Auth.CloudCredentials -Version 1.0.0
dotnet add package Refinitiv.EDP.AutoRest.Auth.CloudCredentials --version 1.0.0
<PackageReference Include="Refinitiv.EDP.AutoRest.Auth.CloudCredentials" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Refinitiv.EDP.AutoRest.Auth.CloudCredentials --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Refinitiv.EDP.AutoRest.Auth.CloudCredentials

The classes in this package are generated by AutoRest tool. The swagger file for this package is from the Elektron Data Platform APIs.

Version

  • 1.0.0 => /auth/cloud-credentials/v1

Creation

The following commands are used to create classes in the package.

  1. It uses a tool from https://github.com/TR-API-Samples/Article.EDP.REST.AutoRest to modify the swagger file
node app.js --input auth_cloud-credentials_v1json --output auth_cloud-credentials_v1_mod.json
  1. It uses the AutoRest command to generate the C# code
autorest --input-file=auth_cloud-credentials_v1_mod.json --csharp --output-folder=CSharp_auth_cloudcredentials --namespace=Refinitiv.EDP.AutoRest.Auth.CloudCredentials --add-credentials

Usage

The generated C# classes support both synchronous and asynchronous methods. The following code demonstrates how to use the synchronous method.

using Refinitiv.EDP.AutoRest.Auth.CloudCredentials;
using Refinitiv.EDP.AutoRest.Auth.CloudCredentials.Models;
using CloudCredentialsError = Refinitiv.EDP.AutoRest.Auth.CloudCredentials.Models.Error;
...

        public CredentialDetails GetCloudCredentials(
            Tokenresponse token, 
            NewsSubscriptionDetails newsSub, 
            out string error)
        {
            TokenCredentials cred = new TokenCredentials(token.AccessToken);
            CloudCredentialsAPI cloudCredential = new CloudCredentialsAPI(cred);

            var response = cloudCredential.Get(newsSub.TransportInfo.Endpoint);

            if (response is CredentialDetails)
            {
                error = null;
                return (CredentialDetails)response;

            }
            else if (response is CloudCredentialsError)
            {
                error = ((CloudCredentialsError)response).ErrorProperty.Message;
                return null;
            }
            else
            {
                error = "Unknown Type";
                return null;
            }
        }

The Tokenresponse object is from Refinitiv.EDP.AutoRest.Auth.OAuth2 and the NewsSubscriptionDetails object is from Refinitiv.EDP.AutoRest.Alerts.

Refinitiv.EDP.AutoRest.Auth.CloudCredentials

The classes in this package are generated by AutoRest tool. The swagger file for this package is from the Elektron Data Platform APIs.

Version

  • 1.0.0 => /auth/cloud-credentials/v1

Creation

The following commands are used to create classes in the package.

  1. It uses a tool from https://github.com/TR-API-Samples/Article.EDP.REST.AutoRest to modify the swagger file
node app.js --input auth_cloud-credentials_v1json --output auth_cloud-credentials_v1_mod.json
  1. It uses the AutoRest command to generate the C# code
autorest --input-file=auth_cloud-credentials_v1_mod.json --csharp --output-folder=CSharp_auth_cloudcredentials --namespace=Refinitiv.EDP.AutoRest.Auth.CloudCredentials --add-credentials

Usage

The generated C# classes support both synchronous and asynchronous methods. The following code demonstrates how to use the synchronous method.

using Refinitiv.EDP.AutoRest.Auth.CloudCredentials;
using Refinitiv.EDP.AutoRest.Auth.CloudCredentials.Models;
using CloudCredentialsError = Refinitiv.EDP.AutoRest.Auth.CloudCredentials.Models.Error;
...

        public CredentialDetails GetCloudCredentials(
            Tokenresponse token, 
            NewsSubscriptionDetails newsSub, 
            out string error)
        {
            TokenCredentials cred = new TokenCredentials(token.AccessToken);
            CloudCredentialsAPI cloudCredential = new CloudCredentialsAPI(cred);

            var response = cloudCredential.Get(newsSub.TransportInfo.Endpoint);

            if (response is CredentialDetails)
            {
                error = null;
                return (CredentialDetails)response;

            }
            else if (response is CloudCredentialsError)
            {
                error = ((CloudCredentialsError)response).ErrorProperty.Message;
                return null;
            }
            else
            {
                error = "Unknown Type";
                return null;
            }
        }

The Tokenresponse object is from Refinitiv.EDP.AutoRest.Auth.OAuth2 and the NewsSubscriptionDetails object is from Refinitiv.EDP.AutoRest.Alerts.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 95 4/30/2019