Exemple #1
0
 public bool InitializeProperty(MemberPath path, Object obj, PropertyInfo propertyInfo)
 {
     if (path.Matches(Pattern))
     {
         propertyInfo.SetValue(obj, AssignmentAction.Assign(path.Content, Parameters));
         return(true);
     }
     return(false);
 }
Exemple #2
0
 public bool InitializeElement(MemberPath path, Array array, int index)
 {
     if (path.Matches(Pattern))
     {
         array.SetValue(AssignmentAction.Assign(path.Content, Parameters), index);
         return(true);
     }
     return(false);
 }
Exemple #3
0
 public bool InitializeCount(MemberPath path, ref int count)
 {
     if (path.Matches(Pattern))
     {
         count = (int)AssignmentAction.Assign(path.Content, Parameters);
         return(true);
     }
     return(false);
 }
Exemple #4
0
        public Task AssignDocumentAttachmentsAsync(string documentId, AssignmentAction action, IEnumerable <EntityReference> attachmentEntities, CancellationToken cancellationToken = default)
        {
            Preconditions.NotNullOrEmpty(documentId, nameof(documentId));
            action.Validate(nameof(action));
            Preconditions.NotNullOrEmpty(attachmentEntities, nameof(attachmentEntities));

            var queryParameters = new QueryParameters(new QueryParameter(nameof(action), action.AsString(EnumJsonConverter.CamelCaseNameFormat)));

            return(PatchAsync($"{documentId}/attachments", queryParameters.ToString(), JsonStreamContent.Create(attachmentEntities), nameof(AssignDocumentAttachmentsAsync), documentId, cancellationToken));
        }
Exemple #5
0
        public Task AssignDocumentAttachmentsRawAsync(string documentId, string attachmentEntities, AssignmentAction action, CancellationToken cancellationToken = default)
        {
            action.Validate(nameof(action));

            var queryParameters = new QueryParameters(new QueryParameter(nameof(action), action.AsString(EnumJsonConverter.CamelCaseNameFormat)));

            return(AssignDocumentAttachmentsRawAsync(documentId, attachmentEntities, queryParameters.ToString(), cancellationToken));
        }
Exemple #6
0
 /// <inheritdoc/>
 public Task AssignDocumentAttachmentsAsync(string documentId, AssignmentAction action, IEnumerable <EntityReference> attachmentEntities, CancellationToken cancellationToken = default) => AssignDocumentAttachmentsAsync(documentId, action.Validate(nameof(action)).GetValue() !, attachmentEntities, cancellationToken);
Exemple #7
0
 /// <summary>
 /// Adds or removes contacts in a contact group.
 /// </summary>
 /// <param name="groupId">The unique identifier of the contact group to update.</param>
 /// <param name="action">Whether to add or remove the contact.</param>
 /// <param name="contacts">The contacts to add or remove.</param>
 /// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None"/>.</param>
 /// <returns></returns>
 public Task AssignGroupContactsAsync(string groupId, AssignmentAction action, IEnumerable <EntityReference> contacts, CancellationToken cancellationToken = default) => AssignGroupContactsAsync(groupId, action.Validate(nameof(action)).GetValue(), contacts, cancellationToken);