예제 #1
0
 public LanguageVariantUpsertModel GetLanguageVariantUpsertModel <T>(T variantElements, WorkflowStepIdentifier workflow = null) where T : new() =>
예제 #2
0
    /// <inheritdoc />
    public async Task <LanguageVariantModel <T> > UpsertLanguageVariantAsync <T>(LanguageVariantIdentifier identifier, T variantElements, WorkflowStepIdentifier workflow = null) where T : new()
    {
        if (identifier == null)
        {
            throw new ArgumentNullException(nameof(identifier));
        }

        if (variantElements == null)
        {
            throw new ArgumentNullException(nameof(variantElements));
        }

        var endpointUrl        = _urlBuilder.BuildVariantsUrl(identifier);
        var variantUpsertModel = _modelProvider.GetLanguageVariantUpsertModel(variantElements, workflow);
        var response           = await _actionInvoker.InvokeMethodAsync <LanguageVariantUpsertModel, LanguageVariantModel>(endpointUrl, HttpMethod.Put, variantUpsertModel);

        return(_modelProvider.GetLanguageVariantModel <T>(response));
    }
예제 #3
0
    /// <inheritdoc />
    public async Task ChangeLanguageVariantWorkflowAsync(LanguageVariantIdentifier identifier, WorkflowStepIdentifier workflowStepIdentifier)
    {
        if (identifier == null)
        {
            throw new ArgumentNullException(nameof(identifier));
        }

        if (workflowStepIdentifier == null)
        {
            throw new ArgumentNullException(nameof(workflowStepIdentifier));
        }

        var endpointUrl = _urlBuilder.BuildWorkflowChangeUrl(identifier);

        await _actionInvoker.InvokeMethodAsync(endpointUrl, HttpMethod.Put, workflowStepIdentifier);
    }
예제 #4
0
 internal LanguageVariantUpsertModel(LanguageVariantModel languageVariant)
 {
     Elements = languageVariant.Elements;
     Workflow = languageVariant.Workflow;
 }