/// <summary>
 /// Initializes a new instance of the <see cref="T:Sdk.Api.ApiRequestSender"/> class.
 /// </summary>
 /// <param name="configuration">Configuration.</param>
 /// <param name="credentials">Credentials to use in authorized requests and to refresh tokens</param>
 /// <param name="oauthService">OAuthService.</param>
 /// <param name="httpSender">HTTP instance to send API requests</param>
 internal ApiRequestSender(Configuration configuration, ICredentials credentials, IBynderClient bynderClient, IHttpRequestSender httpSender)
 {
     _configuration = configuration;
     _credentials   = credentials;
     _bynderClient  = bynderClient;
     _httpSender    = httpSender;
 }
Beispiel #2
0
 public CombinedValidationWorker(
     ModelValidationWorker modelValidationWorker,
     BynderSettingsValidationWorker bynderSettingsValidationWorker,
     IBynderClient bynderClient)
 {
     _modelValidationWorker          = modelValidationWorker;
     _bynderSettingsValidationWorker = bynderSettingsValidationWorker;
     _bynderClient = bynderClient;
 }
        private static async Task QueryBynderUsingOAuth(IBynderClient client)
        {
            using var waitForToken = new WaitForToken();
            using var listener     = new UrlHttpListener("http://localhost:8888/", waitForToken);

            Browser.Launch(client.GetOAuthService().GetAuthorisationUrl("state example", "offline asset:read collection:read"));
            waitForToken.WaitHandle.WaitOne(50000);

            if (waitForToken.Success)
            {
                client.GetOAuthService().GetAccessTokenAsync(waitForToken.Token, "offline asset:read collection:read").Wait();
                await QueryBynder(client);
            }
        }
        private static async Task QueryBynder(IBynderClient client)
        {
            var mediaList = await client.GetAssetService().GetMediaListAsync(new MediaQuery());

            foreach (var media in mediaList)
            {
                Console.WriteLine(media.Name);
            }

            var collectionList = await client.GetCollectionService().GetCollectionsAsync(new GetCollectionsQuery());

            foreach (var collection in collectionList)
            {
                Console.WriteLine(collection.Name);
            }
        }
 public AssetUploadWorker(inRiverContext inRiverContext, IBynderClient bynderClient = null)
 {
     _inRiverContext = inRiverContext;
     _bynderClient   = bynderClient;
 }
 public ResourceMetapropertyUpdateWorker(inRiverContext inRiverContext, IBynderClient bynderClient)
 {
     _inRiverContext = inRiverContext;
     _bynderClient   = bynderClient;
 }
Beispiel #7
0
 private ApiSample(Configuration configuration)
 {
     _bynderClient = ClientFactory.Create(configuration);
 }
 public AssetUsageUpdateWorker(inRiverContext inRiverContext, IBynderClient bynderBynderClient)
 {
     _inRiverContext     = inRiverContext;
     _bynderBynderClient = bynderBynderClient;
 }
Beispiel #9
0
 public AssetUpdatedWorker(inRiverContext inRiverContext, IBynderClient bynderClient, FilenameEvaluator fileNameEvaluator)
 {
     _inRiverContext    = inRiverContext;
     _bynderClient      = bynderClient;
     _fileNameEvaluator = fileNameEvaluator;
 }
 /// <summary>
 /// Create an instance of <see cref="IApiRequestSender"/> given the specified configuration and credentials.
 /// </summary>
 /// <returns>The instance.</returns>
 /// <param name="configuration">Configuration.</param>
 /// <param name="credentials">Credentials.</param>
 /// <param name="oauthService">OAuthService.</param>
 public static IApiRequestSender Create(Configuration configuration, ICredentials credentials, IBynderClient bynderClient)
 {
     return(new ApiRequestSender(configuration, credentials, bynderClient, new HttpRequestSender()));
 }