示例#1
0
 public TestOCAPIClients(SFCCEnvironmentFixture fixture)
 {
     _sitesClient             = fixture.ServiceProvider.GetService <ISites>();
     _jobsClient              = fixture.ServiceProvider.GetService <IJobs>();
     _globalPreferencesClient = fixture.ServiceProvider.GetService <IGlobalPreferences>();
     _orderSearchClient       = fixture.ServiceProvider.GetService <IOrderSearch>();
     _ordersClient            = fixture.ServiceProvider.GetService <IOrders>();
     _jobSearchClient         = fixture.ServiceProvider.GetService <IJobExecutionSearch>();
     _codeVersionsClient      = fixture.ServiceProvider.GetService <ICodeVersions>();
 }
示例#2
0
        public SyncCommand(ILogger <SyncCommand> logger, IConsoleOutput console, IWebDAVClient client,
                           ICodeVersions codeVersionsClient, IOptions <SFCCEnvironment> env)
        {
            _logger             = logger;
            _console            = console;
            _client             = client;
            _codeVersionsClient = codeVersionsClient;
            _env = env.Value;

            if (string.IsNullOrEmpty(_env.CodeVersion))
            {
                throw new SFCCEnvironmentException("A valid code version must be specified in configuration");
            }
        }
示例#3
0
        public static async Task <bool> ActivateCodeVersion(this ICodeVersions codeVersionsClient, string id)
        {
            try
            {
                var result = await codeVersionsClient.Update(id, new CodeVersion()
                {
                    Active = true,
                    // only the active field is appropriate for this call
                    LastModificationTime = null,
                    ActivationTime       = null
                });

                return(result.Active);
            }
            catch (ApiException ex)
            {
                return(false);
            }
        }