public async Task <ScItemsResponse> CreateItemAsync(ICreateItemByIdRequest request, CancellationToken cancelToken = default(CancellationToken)) { ICreateItemByIdRequest requestCopy = request.DeepCopyCreateItemByIdRequest(); using (ICredentialsHeadersCryptor cryptor = await this.GetCredentialsCryptorAsync(cancelToken)) { ICreateItemByIdRequest autocompletedRequest = this.requestMerger.FillCreateItemByIdGaps(requestCopy); var urlBuilder = new CreateItemByIdUrlBuilder(this.restGrammar, this.webApiGrammar); var taskFlow = new CreateItemByIdTask(urlBuilder, this.httpClient, cryptor); return(await RestApiCallFlow.LoadRequestFromNetworkFlow(autocompletedRequest, taskFlow, cancelToken)); } }
public void SetUp() { IRestServiceGrammar restGrammar = RestServiceGrammar.ItemWebApiV2Grammar(); IWebApiUrlParameters webApiGrammar = WebApiUrlParameters.ItemWebApiV2UrlParameters(); this.builder = new CreateItemByIdUrlBuilder(restGrammar, webApiGrammar); SessionConfigPOD mutableSessionConfig = new SessionConfigPOD(); mutableSessionConfig.ItemWebApiVersion = "v234"; mutableSessionConfig.InstanceUrl = "mobiledev1ua1.dk.sitecore.net:7119"; mutableSessionConfig.Site = "/sitecore/shell"; ItemSource source = LegacyConstants.DefaultSource(); this.requestMerger = new UserRequestMerger(mutableSessionConfig, source); }
public void SetUp() { IRestServiceGrammar restGrammar = RestServiceGrammar.ItemWebApiV2Grammar(); IWebApiUrlParameters webApiGrammar = WebApiUrlParameters.ItemWebApiV2UrlParameters(); this.builder = new CreateItemByIdUrlBuilder(restGrammar, webApiGrammar); SessionConfigPOD mutableSessionConfig = new SessionConfigPOD(); mutableSessionConfig.ItemWebApiVersion = "v234"; mutableSessionConfig.InstanceUrl = "mobiledev1ua1.dk.sitecore.net:7119"; mutableSessionConfig.Site = "/sitecore/shell"; ItemSource source = LegacyConstants.DefaultSource(); this.requestMerger = new UserRequestMerger(mutableSessionConfig, source); }
public void TearDown() { this.builder = null; }
public async Task<ScItemsResponse> CreateItemAsync(ICreateItemByIdRequest request, CancellationToken cancelToken = default(CancellationToken)) { ICreateItemByIdRequest requestCopy = request.DeepCopyCreateItemByIdRequest(); using (ICredentialsHeadersCryptor cryptor = await this.GetCredentialsCryptorAsync(cancelToken)) { ICreateItemByIdRequest autocompletedRequest = this.requestMerger.FillCreateItemByIdGaps(requestCopy); var urlBuilder = new CreateItemByIdUrlBuilder(this.restGrammar, this.webApiGrammar); var taskFlow = new CreateItemByIdTask(urlBuilder, this.httpClient, cryptor); return await RestApiCallFlow.LoadRequestFromNetworkFlow(autocompletedRequest, taskFlow, cancelToken); } }
public CreateItemByIdTask(CreateItemByIdUrlBuilder urlBuilder, HttpClient httpClient, ICredentialsHeadersCryptor credentialsHeadersCryptor) : base(httpClient, credentialsHeadersCryptor) { this.urlBuilder = urlBuilder; }
public void TearDown() { this.builder = null; }