public List <ActionObjectPath> GetRequest(IIdProvider idProvider)
        {
            IdentityPath = idProvider.GetActionId();
            QueryIdPath  = idProvider.GetActionId();

            List <ActionObjectPath> actions      = new List <ActionObjectPath>();
            ActionObjectPath        spoOperation = new ActionObjectPath()
            {
                Action = new QueryAction()
                {
                    Id           = QueryIdPath,
                    ObjectPathId = IdentityPath.ToString(),
                    SelectQuery  = new SelectQuery()
                    {
                        SelectAllProperties = false,
                        Properties          = new List <Property>()
                        {
                            new Property()
                            {
                                Name = "PollingInterval"
                            },
                            new Property()
                            {
                                Name = "IsComplete"
                            },
                        }
                    }
                }
            };

            ActionObjectPath identity = new ActionObjectPath()
            {
                ObjectPath = new Identity()
                {
                    Id   = IdentityPath,
                    Name = ObjectIdentity.Replace("\n", "&#xA;")
                }
            };

            actions.Add(spoOperation);
            actions.Add(identity);
            return(actions);
        }
        public void UpdateOvervriteVersionRequest_Test_GetRequest()
        {
            UpdateListItemRequest request = new UpdateOverwriteVersionRequest("test-site-id", "test-web-id", "test-list-id", 1);

            request.FieldsToUpdate.Add(new CSOMItemField()
            {
                FieldName  = "Test Field",
                FieldType  = "String",
                FieldValue = "Test field value"
            });
            IIdProvider             idProvider        = new IteratorIdProvider();
            List <ActionObjectPath> actionObjectPaths = request.GetRequest(idProvider);

            ActionObjectPath setFieldsActionPath = actionObjectPaths[0];

            Assert.AreEqual("<Method Name=\"SetFieldValue\" Id=\"4\" ObjectPathId=\"1\"><Parameters><Parameter Type=\"String\">Test Field</Parameter><Parameter Type=\"String\">Test field value</Parameter></Parameters></Method>", setFieldsActionPath.Action.ToString());

            ActionObjectPath actionObjectPath = actionObjectPaths[1];

            Assert.AreEqual("<Method Name=\"UpdateOverwriteVersion\" Id=\"5\" ObjectPathId=\"1\"></Method>", actionObjectPath.Action.ToString());
            Assert.AreEqual("<Identity Id=\"1\" Name=\"121a659f-e03e-2000-4281-1212829d67dd|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:test-site-id:web:test-web-id:list:test-list-id:item:1,1\" />", actionObjectPath.ObjectPath.ToString());
        }
Beispiel #3
0
        public List <ActionObjectPath> GetRequest(IIdProvider idProvider)
        {
            int removeSiteId = idProvider.GetActionId();

            IdentityPath = idProvider.GetActionId();
            QueryIdPath  = idProvider.GetActionId();

            #region XML Payload generated

            /*
             * <Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="pnp core sdk"
             *  xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
             *  <Actions>
             *      <Query Id="3" ObjectPathId="1">
             *          <Query SelectAllProperties="false">
             *              <Properties>
             *                  <Property Name="PollingInterval" ScalarProperty="true" />
             *                  <Property Name="IsComplete" ScalarProperty="true" />
             *              </Properties>
             *          </Query>
             *      </Query>
             *  </Actions>
             *  <ObjectPaths>
             *      <Constructor Id="2" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" />
             *      <Method Id="1" ParentId="2" Name="RemoveSite">
             *          <Parameters>
             *              <Parameter Type="String">https://bertonline.sharepoint.com/sites/removeme</Parameter>
             *          </Parameters>
             *      </Method>
             *  </ObjectPaths>
             * </Request>
             */
            #endregion

            List <ActionObjectPath> actions      = new List <ActionObjectPath>();
            ActionObjectPath        spoOperation = new ActionObjectPath()
            {
                Action = new QueryAction()
                {
                    Id           = QueryIdPath,
                    ObjectPathId = removeSiteId.ToString(),
                    SelectQuery  = new SelectQuery()
                    {
                        SelectAllProperties = false,
                        Properties          = new List <Property>()
                        {
                            new Property()
                            {
                                Name = "PollingInterval"
                            },
                            new Property()
                            {
                                Name = "IsComplete"
                            },
                        }
                    }
                }
            };

            ActionObjectPath removeSiteAction = new ActionObjectPath()
            {
                ObjectPath = new ObjectPathMethod()
                {
                    Id         = removeSiteId,
                    ParentId   = IdentityPath,
                    Name       = operationName,
                    Parameters = new MethodParameter()
                    {
                        Properties = new List <Parameter>()
                        {
                            new Parameter()
                            {
                                Value = SiteUrl.AbsoluteUri.ToString(),
                            }
                        }
                    }
                }
            };


            ActionObjectPath spoOperationCollection = new ActionObjectPath()
            {
                ObjectPath = new ConstructorPath
                {
                    Id     = IdentityPath,
                    TypeId = PnPAdminConstants.CsomTenantObject
                }
            };

            actions.Add(spoOperation);
            actions.Add(spoOperationCollection);
            actions.Add(removeSiteAction);

            return(actions);
        }
        public List <ActionObjectPath> GetRequest(IIdProvider idProvider)
        {
            string   identityObjectName = GenerateIdentityName();
            Identity identity           = new Identity()
            {
                Name = identityObjectName,
                Id   = idProvider.GetActionId()
            };

            List <ActionObjectPath> result = new List <ActionObjectPath>();
            //Set term store id
            ActionObjectPath setTermStoreId = new ActionObjectPath()
            {
                Action = new SetPropertyAction()
                {
                    Id           = idProvider.GetActionId(),
                    ObjectPathId = identity.Id.ToString(),
                    Name         = "SspId",
                    SetParameter = new Parameter()
                    {
                        Type  = "Guid",
                        Value = TermStoreId
                    }
                }
            };

            result.Add(setTermStoreId);

            //Set term set id
            ActionObjectPath setTermSetId = new ActionObjectPath()
            {
                Action = new SetPropertyAction()
                {
                    Id           = idProvider.GetActionId(),
                    ObjectPathId = identity.Id.ToString(),
                    Name         = "TermSetId",
                    SetParameter = new Parameter()
                    {
                        Type  = "Guid",
                        Value = TermSetId
                    }
                }
            };

            result.Add(setTermSetId);

            //Set target template
            ActionObjectPath setTargetTemplate = new ActionObjectPath()
            {
                Action = new SetPropertyAction()
                {
                    Id           = idProvider.GetActionId(),
                    ObjectPathId = identity.Id.ToString(),
                    Name         = "TargetTemplate",
                    SetParameter = new Parameter()
                    {
                        Type  = "String",
                        Value = string.Empty
                    }
                }
            };

            result.Add(setTargetTemplate);

            //Set AnchorId
            ActionObjectPath setAnchorId = new ActionObjectPath()
            {
                Action = new SetPropertyAction()
                {
                    Id           = idProvider.GetActionId(),
                    ObjectPathId = identity.Id.ToString(),
                    Name         = "AnchorId",
                    SetParameter = new Parameter()
                    {
                        Type  = "Guid",
                        Value = Guid.Empty
                    }
                }
            };

            result.Add(setAnchorId);

            //Call update method
            ActionObjectPath updateMethod = new ActionObjectPath()
            {
                Action = new MethodAction()
                {
                    Id           = idProvider.GetActionId(),
                    ObjectPathId = identity.Id.ToString(),
                    Name         = "Update"
                },
                ObjectPath = identity
            };

            result.Add(updateMethod);

            return(result);
        }
        List <ActionObjectPath> IFieldUpdateStrategy.GetFieldUpdateAction(CSOMItemField fld, Identity identity)
        {
            int getByInternalNameOrTitleId     = IdProvider.GetActionId();
            int taxonomyParameterConstructorId = IdProvider.GetActionId();
            //Set field value
            MethodAction setFieldValueByValue = new MethodAction
            {
                ObjectPathId = getByInternalNameOrTitleId.ToString(),
                Id           = IdProvider.GetActionId(),
                Name         = "SetFieldValueByValueCollection",
                Parameters   = new List <Parameter>()
                {
                    new ObjectReferenceParameter()
                    {
                        ObjectPathId = identity.Id
                    },
                    new ObjectReferenceParameter()
                    {
                        ObjectPathId = taxonomyParameterConstructorId
                    }
                }
            };

            //Get field
            ObjectPathMethod getFieldByInternalNameMethod = new ObjectPathMethod
            {
                Id         = getByInternalNameOrTitleId,
                ParentId   = FieldsProperty.Id,
                Name       = "GetByInternalNameOrTitle",
                Parameters = new MethodParameter()
                {
                    Properties = new List <Parameter>()
                    {
                        new Parameter()
                        {
                            Type  = "String",
                            Value = fld.FieldName
                        }
                    }
                }
            };

            //Create taxonomy collection
            List <Parameter> parameters = fld.GetRequestParameters(/*identity.Id*/ getByInternalNameOrTitleId);

            parameters.Reverse();

            ConstructorPath taxonomyCollectionConstructor = new ConstructorPath
            {
                Id         = taxonomyParameterConstructorId,
                TypeId     = "{c3dfae10-f3bf-4894-9012-bb60665b6d91}",
                Parameters = new MethodParameter()
                {
                    Properties = parameters
                }
            };

            ActionObjectPath setTaxonomyActionObject = new ActionObjectPath()
            {
                Action     = setFieldValueByValue,
                ObjectPath = getFieldByInternalNameMethod
            };

            ActionObjectPath constructTaxonomyCollection = new ActionObjectPath()
            {
                ObjectPath = taxonomyCollectionConstructor
            };

            return(new List <ActionObjectPath>()
            {
                setTaxonomyActionObject,
                constructTaxonomyCollection
            });
        }
Beispiel #6
0
        public List <ActionObjectPath> GetRequest(IIdProvider idProvider)
        {
            StaticProperty siteProperty = new StaticProperty()
            {
                Name   = "Current",
                TypeId = "{3747adcd-a3c3-41b9-bfab-4a64dd2f1e0a}",
                Id     = idProvider.GetActionId()
            };

            Property web = new Property()
            {
                Id       = idProvider.GetActionId(),
                ParentId = siteProperty.Id,
                Name     = "Web"
            };

            Property contentTypes = new Property()
            {
                Id       = idProvider.GetActionId(),
                Name     = "ContentTypes",
                ParentId = web.Id
            };

            ObjectPathMethod addCtMethod = new ObjectPathMethod()
            {
                Id         = idProvider.GetActionId(),
                ParentId   = contentTypes.Id,
                Name       = "Add",
                Parameters = new MethodParameter()
                {
                    TypeId     = "{168f3091-4554-4f14-8866-b20d48e45b54}",
                    Properties = new List <Parameter>()
                    {
                        new ContentTypeCreationParameter()
                        {
                            Value = ContentTypeCreationInfo
                        }
                    }
                }
            };

            List <ActionObjectPath> result = new List <ActionObjectPath>();

            ActionObjectPath path = new ActionObjectPath()
            {
                Action = new BaseAction()
                {
                    Id           = idProvider.GetActionId(),
                    ObjectPathId = addCtMethod.Id.ToString()
                },
                ObjectPath = addCtMethod,
            };

            result.Add(path);

            ActionObjectPath identityQuery = new ActionObjectPath()
            {
                Action = new IdentityQueryAction()
                {
                    Id           = idProvider.GetActionId(),
                    ObjectPathId = addCtMethod.Id.ToString()
                },
                ObjectPath = contentTypes
            };

            result.Add(identityQuery);

            ActionObjectPath webIdentity = new ActionObjectPath()
            {
                ObjectPath = web
            };

            result.Add(webIdentity);

            ActionObjectPath siteIdentity = new ActionObjectPath()
            {
                ObjectPath = siteProperty
            };

            result.Add(siteIdentity);

            return(result);
        }
Beispiel #7
0
        public List <ActionObjectPath> GetRequest(IIdProvider idProvider)
        {
            IdentityPath = idProvider.GetActionId();
            QueryIdPath  = idProvider.GetActionId();
            int getSitePropertiesByUrl = idProvider.GetActionId();

            #region XML Payload generated

            /*
             * <Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName=".NET Library"
             *  xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
             *  <Actions>
             *      <ObjectPath Id="2" ObjectPathId="1" />
             *      <ObjectPath Id="4" ObjectPathId="3" />
             *      <Query Id="5" ObjectPathId="3">
             *          <Query SelectAllProperties="true">
             *                  <Properties />
             *          </Query>
             *      </Query>
             *  </Actions>
             *  <ObjectPaths>
             *      <Constructor Id="1" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" />
             *      <Method Id="3" ParentId="1" Name="GetSiteByUrl">
             *          <Parameters>
             *              <Parameter Type="String">https://bertonline.sharepoint.com/sites/prov-1</Parameter>
             *          </Parameters>
             *      </Method>
             *  </ObjectPaths>
             * </Request>
             */
            #endregion

            List <ActionObjectPath> actions = new List <ActionObjectPath>();

            ActionObjectPath spoOperation = new ActionObjectPath()
            {
                Action = new BaseAction()
                {
                    Id           = idProvider.GetActionId(),
                    ObjectPathId = IdentityPath.ToString()
                },
            };

            ActionObjectPath spoOperation2 = new ActionObjectPath()
            {
                Action = new BaseAction()
                {
                    Id           = idProvider.GetActionId(),
                    ObjectPathId = getSitePropertiesByUrl.ToString()
                },
            };

            ActionObjectPath spoOperation3 = new ActionObjectPath()
            {
                Action = new QueryAction()
                {
                    Id           = QueryIdPath,
                    ObjectPathId = getSitePropertiesByUrl.ToString(),
                    SelectQuery  = new SelectQuery()
                    {
                        SelectAllProperties = true
                    }
                },
            };

            ActionObjectPath createSiteAction = new ActionObjectPath()
            {
                ObjectPath = new ObjectPathMethod()
                {
                    Id         = getSitePropertiesByUrl,
                    ParentId   = IdentityPath,
                    Name       = "GetSiteByUrl",
                    Parameters = new MethodParameter()
                    {
                        Properties = new List <Parameter>()
                        {
                            new Parameter()
                            {
                                Type  = "String",
                                Value = SiteUrl.AbsoluteUri
                            }
                        }
                    }
                }
            };

            ActionObjectPath spoGetSitePropertiesByUrlCollection = new ActionObjectPath()
            {
                ObjectPath = new ConstructorPath
                {
                    Id     = IdentityPath,
                    TypeId = PnPAdminConstants.CsomTenantObject
                }
            };

            actions.Add(spoOperation);
            actions.Add(spoOperation2);
            actions.Add(spoOperation3);
            actions.Add(createSiteAction);
            actions.Add(spoGetSitePropertiesByUrlCollection);

            return(actions);
        }
Beispiel #8
0
        public List <ActionObjectPath> GetRequest(IIdProvider idProvider)
        {
            StaticProperty siteProperty = new StaticProperty()
            {
                Name   = "Current",
                TypeId = "{3747adcd-a3c3-41b9-bfab-4a64dd2f1e0a}",
                Id     = idProvider.GetActionId()
            };

            Property web = new Property()
            {
                Id       = idProvider.GetActionId(),
                ParentId = siteProperty.Id,
                Name     = "Web"
            };

            List <ActionObjectPath> result = new List <ActionObjectPath>();

            ActionObjectPath path = new ActionObjectPath()
            {
                Action = new BaseAction()
                {
                    Id           = idProvider.GetActionId(),
                    ObjectPathId = siteProperty.Id.ToString()
                },
            };

            result.Add(path);

            ActionObjectPath path2 = new ActionObjectPath()
            {
                Action = new BaseAction()
                {
                    Id           = idProvider.GetActionId(),
                    ObjectPathId = web.Id.ToString()
                },
            };

            result.Add(path2);

            ActionObjectPath identityQuery = new ActionObjectPath()
            {
                Action = new QueryAction()
                {
                    Id           = idProvider.GetActionId(),
                    ObjectPathId = web.Id.ToString(),
                    SelectQuery  = new SelectQuery()
                    {
                        SelectAllProperties = false,
                        Properties          = new List <Property>()
                        {
                            new Property()
                            {
                                Name = "Title"
                            }
                        }
                    }
                },
            };

            result.Add(identityQuery);

            IdentityPath = identityQuery.Action.Id;

            ActionObjectPath webIdentity = new ActionObjectPath()
            {
                ObjectPath = web
            };

            result.Add(webIdentity);

            ActionObjectPath siteIdentity = new ActionObjectPath()
            {
                ObjectPath = siteProperty
            };

            result.Add(siteIdentity);

            return(result);
        }
        public List <ActionObjectPath> GetRequest(IIdProvider idProvider)
        {
            IdentityPath = idProvider.GetActionId();
            QueryIdPath  = idProvider.GetActionId();
            int updateId = idProvider.GetActionId();

            #region XML Payload generated

            /*
             * <Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="pnp core sdk"
             *  xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
             *  <Actions>
             *      <SetProperty Id="4" ObjectPathId="1" Name="DisableFlows">
             *          <Parameter Type="Enum">2</Parameter>
             *      </SetProperty>
             *      <SetProperty Id="5" ObjectPathId="1" Name="Title">
             *          <Parameter Type="String">New title 1</Parameter>
             *      </SetProperty>
             *      <Query Id="2" ObjectPathId="3">
             *          <Query SelectAllProperties="false">
             *              <Properties>
             *                  <Property Name="PollingInterval" ScalarProperty="true" />
             *                  <Property Name="IsComplete" ScalarProperty="true" />
             *              </Properties>
             *          </Query>
             *      </Query>
             *      <ObjectPath Id="6" ObjectPathId="3" />
             *      <ObjectIdentityQuery Id="7" ObjectPathId="1" />
             *  </Actions>
             *  <ObjectPaths>
             *      <Method Id="3" ParentId="1" Name="Update" />
             *      <Identity Id="1" Name="0a94fb9f-8071-3000-513c-5633d32c844e|908bed80-a04a-4433-b4a0-883d9847d110:6492ece7-7f5d-4499-8130-50e761e25bd9&#xA;SiteProperties&#xA;https://bertonline.sharepoint.com/sites/prov-1" />
             *  </ObjectPaths>
             * </Request>
             */
            #endregion

            List <ActionObjectPath> actions = new List <ActionObjectPath>();

            var fieldsToUpdate = GetFieldsToUpdate();
            foreach (var field in fieldsToUpdate)
            {
                ActionObjectPath updateProperty = new ActionObjectPath()
                {
                    Action = new SetPropertyAction()
                    {
                        Id           = idProvider.GetActionId(),
                        ObjectPathId = IdentityPath.ToString(),
                        Name         = field.FieldName,
                        SetParameter = new Parameter()
                        {
                            Type  = field.FieldType,
                            Value = field.FieldValue
                        }
                    }
                };

                actions.Add(updateProperty);
            }

            ActionObjectPath spoOperation = new ActionObjectPath()
            {
                Action = new QueryAction()
                {
                    Id           = QueryIdPath,
                    ObjectPathId = updateId.ToString(),
                    SelectQuery  = new SelectQuery()
                    {
                        SelectAllProperties = false,
                        Properties          = new List <Property>()
                        {
                            new Property()
                            {
                                Name = "PollingInterval"
                            },
                            new Property()
                            {
                                Name = "IsComplete"
                            },
                        }
                    }
                }
            };

            ActionObjectPath spoOperation2 = new ActionObjectPath()
            {
                Action = new BaseAction()
                {
                    Id           = idProvider.GetActionId(),
                    ObjectPathId = updateId.ToString()
                },
            };

            ActionObjectPath spoOperation3 = new ActionObjectPath()
            {
                Action = new IdentityQueryAction()
                {
                    Id           = idProvider.GetActionId(),
                    ObjectPathId = IdentityPath.ToString()
                },
            };

            ActionObjectPath updateSitePropertiesAction = new ActionObjectPath()
            {
                ObjectPath = new ObjectPathMethod()
                {
                    Id       = updateId,
                    ParentId = IdentityPath,
                    Name     = "Update"
                }
            };

            ActionObjectPath updateSitePropertiesIdentity = new ActionObjectPath()
            {
                ObjectPath = new Identity()
                {
                    Id   = IdentityPath,
                    Name = Properties.ObjectIdentity.Replace("\n", "&#xA;")
                }
            };

            actions.Add(spoOperation);
            actions.Add(spoOperation2);
            actions.Add(spoOperation3);
            actions.Add(updateSitePropertiesAction);
            actions.Add(updateSitePropertiesIdentity);

            return(actions);
        }
Beispiel #10
0
        public List <ActionObjectPath> GetRequest(IIdProvider idProvider)
        {
            #region XML Payload generated

            /*
             * <Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName=".NET Library"
             *  xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
             *  <Actions>
             *      <Method Name="DeleteObject" Id="1044" ObjectPathId="1038" />
             *      <Method Name="Update" Id="1045" ObjectPathId="82">
             *          <Parameters>
             *              <Parameter Type="Boolean">true</Parameter>
             *          </Parameters>
             *      </Method>
             *  </Actions>
             *  <ObjectPaths>
             *      <Identity Id="1038" Name="17a30ea0-40c4-3000-787b-49a88f37947e|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:b56adf79-ff6a-4964-a63a-ff1fa23be9f8:web:8c8e101c-1b0d-4253-85e7-c30039bf46e2:contenttype:0x01007D2D52B86CBD804BA6D9F006DF19F8DC:fl:4d4fbc21-ecf7-40e4-b42b-d23b6c854789" />
             *      <Identity Id="82" Name="17a30ea0-309d-3000-787b-42c706a1e455|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:b56adf79-ff6a-4964-a63a-ff1fa23be9f8:web:8c8e101c-1b0d-4253-85e7-c30039bf46e2:contenttype:0x01007D2D52B86CBD804BA6D9F006DF19F8DC" />
             *  </ObjectPaths>
             * </Request>
             */
            #endregion

            int fieldLinkIdentityId   = idProvider.GetActionId();
            int contentTypeIdentityId = idProvider.GetActionId();

            List <ActionObjectPath> actions = new List <ActionObjectPath>();

            ActionObjectPath deleteMethod = new ActionObjectPath
            {
                Action = new MethodAction
                {
                    Name         = "DeleteObject",
                    ObjectPathId = fieldLinkIdentityId.ToString(),
                    Id           = idProvider.GetActionId()
                }
            };

            ActionObjectPath updateMethod = new ActionObjectPath
            {
                Action = new MethodAction
                {
                    Name         = "Update",
                    ObjectPathId = contentTypeIdentityId.ToString(),
                    Id           = idProvider.GetActionId(),
                    Parameters   = new List <Parameter>()
                    {
                        new Parameter
                        {
                            Type  = "Boolean",
                            Value = IsListField ? false : UpdateContentType
                        }
                    }
                }
            };


            ActionObjectPath contentTypeIdentity = new ActionObjectPath
            {
                ObjectPath = new Identity
                {
                    Id   = contentTypeIdentityId,
                    Name = $"6ba80da0-b09a-3000-7e8f-67b158a69089|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:{ContentType.PnPContext.Site.Id}:web:{ContentType.PnPContext.Web.Id}:contenttype:{ContentType.StringId}"
                }
            };

            ActionObjectPath fieldLinkIdentity = new ActionObjectPath
            {
                ObjectPath = new Identity
                {
                    Id   = fieldLinkIdentityId,
                    Name = $"6ba80da0-b09a-3000-7e8f-67b158a69089|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:{ContentType.PnPContext.Site.Id}:web:{ContentType.PnPContext.Web.Id}:contenttype:{ContentType.StringId}:fl:{FieldLink.Id}"
                }
            };

            ActionObjectPath listContentTypeIdentity = null;
            ActionObjectPath listFieldLinkIdentity   = null;

            if (IsListField)
            {
                listContentTypeIdentity = new ActionObjectPath
                {
                    ObjectPath = new Identity
                    {
                        Id   = contentTypeIdentityId,
                        Name = $"6ba80da0-b09a-3000-7e8f-67b158a69089|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:{ContentType.PnPContext.Site.Id}:web:{ContentType.PnPContext.Web.Id}:list:{List.Id}:contenttype:{ContentType.StringId}"
                    }
                };

                listFieldLinkIdentity = new ActionObjectPath
                {
                    ObjectPath = new Identity
                    {
                        Id   = fieldLinkIdentityId,
                        Name = $"6ba80da0-b09a-3000-7e8f-67b158a69089|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:{ContentType.PnPContext.Site.Id}:web:{ContentType.PnPContext.Web.Id}:list:{List.Id}:contenttype:{ContentType.StringId}:fl:{FieldLink.Id}"
                    }
                };
            }

            actions.Add(deleteMethod);
            actions.Add(updateMethod);

            if (IsListField)
            {
                actions.Add(listContentTypeIdentity);
                actions.Add(listFieldLinkIdentity);
            }
            else
            {
                actions.Add(contentTypeIdentity);
                actions.Add(fieldLinkIdentity);
            }

            return(actions);
        }
        public List <ActionObjectPath> GetRequest(IIdProvider idProvider)
        {
            #region XML Payload generated

            /*
             * <Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName=".NET Library"
             *  xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
             *  <Actions>
             *      <ObjectPath Id="1034" ObjectPathId="1033" />
             *      <ObjectIdentityQuery Id="1035" ObjectPathId="1033" />
             *      <Method Name="Update" Id="1036" ObjectPathId="82">
             *          <Parameters>
             *              <Parameter Type="Boolean">true</Parameter>
             *          </Parameters>
             *      </Method>
             *  </Actions>
             *  <ObjectPaths>
             *      <Method Id="1033" ParentId="83" Name="Add">
             *          <Parameters>
             *              <Parameter TypeId="{63fb2c92-8f65-4bbb-a658-b6cd294403f4}">
             *                  <Property Name="Field" ObjectPathId="9" />
             *              </Parameter>
             *          </Parameters>
             *      </Method>
             *      <Identity Id="82" Name="6ba80da0-b09a-3000-7e8f-67b158a69089|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:b56adf79-ff6a-4964-a63a-ff1fa23be9f8:web:8c8e101c-1b0d-4253-85e7-c30039bf46e2:contenttype:0x01007D2D52B86CBD804BA6D9F006DF19F8DC" />
             *      <Property Id="83" ParentId="82" Name="FieldLinks" />
             *      <Identity Id="9" Name="6ba80da0-a076-3000-b5f5-7110738edd1f|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:b56adf79-ff6a-4964-a63a-ff1fa23be9f8:web:8c8e101c-1b0d-4253-85e7-c30039bf46e2:field:4d4fbc21-ecf7-40e4-b42b-d23b6c854789" />
             *  </ObjectPaths>
             * </Request>
             *
             * or
             *
             * <Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName=".NET Library"
             *  xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
             *  <Actions>
             *      <ObjectPath Id="1145" ObjectPathId="1144" />
             *      <ObjectIdentityQuery Id="1146" ObjectPathId="1144" />
             *      <Method Name="Update" Id="1147" ObjectPathId="1140">
             *          <Parameters>
             *              <Parameter Type="Boolean">false</Parameter>
             *          </Parameters>
             *      </Method>
             *  </Actions>
             *  <ObjectPaths>
             *      <Method Id="1144" ParentId="1141" Name="Add">
             *          <Parameters>
             *              <Parameter TypeId="{63fb2c92-8f65-4bbb-a658-b6cd294403f4}">
             *                  <Property Name="Field" ObjectPathId="84" />
             *              </Parameter>
             *          </Parameters>
             *      </Method>
             *      <Identity Id="1140" Name="0d9a0ea0-b0c6-3000-787b-49b762c80954|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:b56adf79-ff6a-4964-a63a-ff1fa23be9f8:web:8c8e101c-1b0d-4253-85e7-c30039bf46e2:list:a7d48f4d-9be1-4616-ba24-eef4f3ce8170:contenttype:0x01007D2D52B86CBD804BA6D9F006DF19F8DC0077B18BE608EC2643BCDCF04EE620AABD" />
             *      <Property Id="1141" ParentId="1140" Name="FieldLinks" />
             *      <Identity Id="84" Name="0b9a0ea0-80e3-3000-baac-8a54b2429926|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:b56adf79-ff6a-4964-a63a-ff1fa23be9f8:web:8c8e101c-1b0d-4253-85e7-c30039bf46e2:list:a7d48f4d-9be1-4616-ba24-eef4f3ce8170:field:2ac05f93-32ab-44a4-b701-facff0068b4a" />
             *  </ObjectPaths>
             * </Request>
             *
             */
            #endregion

            int addFieldLinkMethodId      = idProvider.GetActionId();
            int fieldLinks                = idProvider.GetActionId();
            int fieldIdentityId           = idProvider.GetActionId();
            int contentTypeIdentityId     = idProvider.GetActionId();
            int listContentTypeIdentityId = idProvider.GetActionId();
            int listFieldIdentityId       = idProvider.GetActionId();
            IdentityQuery = idProvider.GetActionId();

            List <ActionObjectPath> actions = new List <ActionObjectPath>();

            ActionObjectPath objectPath = new ActionObjectPath
            {
                Action = new BaseAction
                {
                    Id           = idProvider.GetActionId(),
                    ObjectPathId = addFieldLinkMethodId.ToString()
                }
            };

            ActionObjectPath objectIdentityQuery = new ActionObjectPath
            {
                Action = new IdentityQueryAction
                {
                    Id           = IdentityQuery,
                    ObjectPathId = addFieldLinkMethodId.ToString()
                }
            };

            ActionObjectPath updateMethod = new ActionObjectPath
            {
                Action = new MethodAction
                {
                    Name         = "Update",
                    ObjectPathId = IsListField ? listContentTypeIdentityId.ToString() : contentTypeIdentityId.ToString(),
                    Id           = idProvider.GetActionId(),
                    Parameters   = new List <Parameter>()
                    {
                        new Parameter
                        {
                            Type  = "Boolean",
                            Value = IsListField ? false : UpdateContentType
                        }
                    }
                }
            };

            ActionObjectPath addFieldLinkAction = new ActionObjectPath()
            {
                ObjectPath = new ObjectPathMethod()
                {
                    Id         = addFieldLinkMethodId,
                    ParentId   = fieldLinks,
                    Name       = "Add",
                    Parameters = new MethodParameter()
                    {
                        Properties = new List <Parameter>()
                        {
                            new Parameter()
                            {
                                TypeId = "63fb2c92-8f65-4bbb-a658-b6cd294403f4",
                                Value  = new IdentityProperty
                                {
                                    Name         = "Field",
                                    ObjectPathId = IsListField ? listFieldIdentityId.ToString() : fieldIdentityId.ToString(),
                                }
                            }
                        }
                    }
                }
            };

            ActionObjectPath fieldLinkProperty = new ActionObjectPath
            {
                ObjectPath = new Property
                {
                    Id       = fieldLinks,
                    ParentId = IsListField ? listContentTypeIdentityId : contentTypeIdentityId,
                    Name     = "FieldLinks"
                }
            };

            ActionObjectPath contentTypeIdentity = new ActionObjectPath
            {
                ObjectPath = new Identity
                {
                    Id   = contentTypeIdentityId,
                    Name = $"6e940ea0-6072-3000-787b-48a3d44d7291|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:{ContentType.PnPContext.Site.Id}:web:{ContentType.PnPContext.Web.Id}:contenttype:{ContentType.StringId}"
                }
            };

            ActionObjectPath fieldIdentity = new ActionObjectPath
            {
                ObjectPath = new Identity
                {
                    Id   = fieldIdentityId,
                    Name = $"6ba80da0-a076-3000-b5f5-7110738edd1f|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:{ContentType.PnPContext.Site.Id}:web:{ContentType.PnPContext.Web.Id}:field:{Field.Id}"
                }
            };

            ActionObjectPath listContentTypeIdentity = null;
            ActionObjectPath listFieldIdentity       = null;

            if (IsListField)
            {
                listContentTypeIdentity = new ActionObjectPath
                {
                    ObjectPath = new Identity
                    {
                        Id   = listContentTypeIdentityId,
                        Name = $"0d9a0ea0-b0c6-3000-787b-49b762c80954|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:{ContentType.PnPContext.Site.Id}:web:{ContentType.PnPContext.Web.Id}:list:{List.Id}:contenttype:{ContentType.StringId}"
                    }
                };

                listFieldIdentity = new ActionObjectPath
                {
                    ObjectPath = new Identity
                    {
                        Id   = listFieldIdentityId,
                        Name = $"0b9a0ea0-80e3-3000-baac-8a54b2429926|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:{ContentType.PnPContext.Site.Id}:web:{ContentType.PnPContext.Web.Id}:list:{List.Id}:field:{Field.Id}"
                    }
                };
            }

            actions.Add(objectPath);
            actions.Add(objectIdentityQuery);
            actions.Add(updateMethod);
            actions.Add(addFieldLinkAction);

            if (IsListField)
            {
                actions.Add(listContentTypeIdentity);
                actions.Add(fieldLinkProperty);
                actions.Add(listFieldIdentity);
            }
            else
            {
                actions.Add(contentTypeIdentity);
                actions.Add(fieldLinkProperty);
                actions.Add(fieldIdentity);
            }

            return(actions);
        }
Beispiel #12
0
        public List <ActionObjectPath> GetRequest(IIdProvider idProvider)
        {
            int createSiteId = idProvider.GetActionId();

            IdentityPath = idProvider.GetActionId();
            QueryIdPath  = idProvider.GetActionId();

            #region XML Payload generated

            /*
             * <Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="pnp core sdk"
             *  xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
             *  <Actions>
             *      <Query Id="3" ObjectPathId="1">
             *          <Query SelectAllProperties="false">
             *              <Properties>
             *                  <Property Name="PollingInterval" ScalarProperty="true" />
             *                  <Property Name="IsComplete" ScalarProperty="true" />
             *              </Properties>
             *          </Query>
             *      </Query>
             *  </Actions>
             *  <ObjectPaths>
             *      <Constructor Id="2" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" />
             *      <Method Id="1" ParentId="2" Name="CreateSite">
             *          <Parameters>
             *              <Parameter TypeId="{11f84fff-b8cf-47b6-8b50-34e692656606}">
             *                  <Property Name="CompatibilityLevel" Type="Int32">0</Property>
             *                  <Property Name="Lcid" Type="Int32">1033</Property>
             *                  <Property Name="Owner" Type="String">[email protected]</Property>
             *                  <Property Name="StorageMaximumLevel" Type="Int64">27487790694400</Property>
             *                  <Property Name="StorageWarningLevel" Type="Int64">27487790694400</Property>
             *                  <Property Name="Template" Type="String">STS#0</Property>
             *                  <Property Name="TimeZoneId" Type="Int32">3</Property>
             *                  <Property Name="Title" Type="String">PnP Core SDK Test</Property>
             *                  <Property Name="Url" Type="String">https://bertonline.sharepoint.com/sites/pnpcoresdktestclassicsitef03a62586d3e41658f8ad2ceb7e53acf</Property>
             *                  <Property Name="UserCodeMaximumLevel" Type="Double">0</Property>
             *                  <Property Name="UserCodeWarningLevel" Type="Double">0</Property>
             *              </Parameter>
             *          </Parameters>
             *      </Method>
             *  </ObjectPaths>
             * </Request>
             */
            #endregion

            List <ActionObjectPath> actions      = new List <ActionObjectPath>();
            ActionObjectPath        spoOperation = new ActionObjectPath()
            {
                Action = new QueryAction()
                {
                    Id           = QueryIdPath,
                    ObjectPathId = createSiteId.ToString(),
                    SelectQuery  = new SelectQuery()
                    {
                        SelectAllProperties = false,
                        Properties          = new List <Property>()
                        {
                            new Property()
                            {
                                Name = "PollingInterval"
                            },
                            new Property()
                            {
                                Name = "IsComplete"
                            },
                        }
                    }
                }
            };

            ActionObjectPath createSiteAction = new ActionObjectPath()
            {
                ObjectPath = new ObjectPathMethod()
                {
                    Id         = createSiteId,
                    ParentId   = IdentityPath,
                    Name       = "CreateSite",
                    Parameters = new MethodParameter()
                    {
                        Properties = new List <Parameter>()
                        {
                            new Parameter()
                            {
                                TypeId = "11f84fff-b8cf-47b6-8b50-34e692656606",
                                Value  = new List <NamedProperty>()
                                {
                                    new NamedProperty()
                                    {
                                        Name  = "CompatibilityLevel",
                                        Type  = "Int32",
                                        Value = "0"
                                    },
                                    new NamedProperty()
                                    {
                                        Name  = "Lcid",
                                        Type  = "Int32",
                                        Value = Lcid.ToString()
                                    },
                                    new NamedProperty()
                                    {
                                        Name  = "Owner",
                                        Type  = "String",
                                        Value = Owner
                                    },
                                    new NamedProperty()
                                    {
                                        Name  = "StorageMaximumLevel",
                                        Type  = "Int64",
                                        Value = "27487790694400"
                                    },
                                    new NamedProperty()
                                    {
                                        Name  = "StorageWarningLevel",
                                        Type  = "Int64",
                                        Value = "27487790694400"
                                    },
                                    new NamedProperty()
                                    {
                                        Name  = "Template",
                                        Type  = "String",
                                        Value = WebTemplate
                                    },
                                    new NamedProperty()
                                    {
                                        Name  = "TimeZoneId",
                                        Type  = "Int32",
                                        Value = TimeZoneId.ToString()
                                    },
                                    new NamedProperty()
                                    {
                                        Name  = "Title",
                                        Type  = "String",
                                        Value = Title
                                    },
                                    new NamedProperty()
                                    {
                                        Name  = "Url",
                                        Type  = "String",
                                        Value = SiteUrl.AbsoluteUri.ToString()
                                    },
                                    new NamedProperty()
                                    {
                                        Name  = "UserCodeMaximumLevel",
                                        Type  = "Double",
                                        Value = "0"
                                    },
                                    new NamedProperty()
                                    {
                                        Name  = "UserCodeWarningLevel",
                                        Type  = "Double",
                                        Value = "0"
                                    },
                                }
                            }
                        }
                    }
                }
            };


            ActionObjectPath spoOperationCollection = new ActionObjectPath()
            {
                ObjectPath = new ConstructorPath
                {
                    Id     = IdentityPath,
                    TypeId = PnPAdminConstants.CsomTenantObject
                }
            };

            actions.Add(spoOperation);
            actions.Add(spoOperationCollection);
            actions.Add(createSiteAction);

            return(actions);
        }
        public List <ActionObjectPath> GetRequest(IIdProvider idProvider)
        {
            IdentityPath = idProvider.GetActionId();
            QueryIdPath  = idProvider.GetActionId();

            #region XML Payload generated

            /*
             *
             * <Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName=".NET Library"
             *  xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
             *  <Actions>
             *      <ObjectPath Id="2" ObjectPathId="1" />
             *      <Query Id="3" ObjectPathId="1">
             *          <Query SelectAllProperties="true">
             *              <Properties />
             *          </Query>
             *      </Query>
             *  </Actions>
             *  <ObjectPaths>
             *      <Constructor Id="1" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" />
             *  </ObjectPaths>
             * </Request>
             *
             */
            #endregion

            List <ActionObjectPath> actions = new List <ActionObjectPath>();

            ActionObjectPath spoOperation = new ActionObjectPath()
            {
                Action = new BaseAction()
                {
                    Id           = idProvider.GetActionId(),
                    ObjectPathId = IdentityPath.ToString()
                },
            };

            ActionObjectPath spoOperation3 = new ActionObjectPath()
            {
                Action = new QueryAction()
                {
                    Id           = QueryIdPath,
                    ObjectPathId = IdentityPath.ToString(),
                    SelectQuery  = new SelectQuery()
                    {
                        SelectAllProperties = true,
                    }
                },
            };

            ActionObjectPath spoGetSitePropertiesByUrlCollection = new ActionObjectPath()
            {
                ObjectPath = new ConstructorPath
                {
                    Id     = IdentityPath,
                    TypeId = PnPAdminConstants.CsomTenantObject
                }
            };

            actions.Add(spoOperation);
            actions.Add(spoOperation3);
            actions.Add(spoGetSitePropertiesByUrlCollection);

            return(actions);
        }
Beispiel #14
0
        public List <ActionObjectPath> GetRequest(IIdProvider idProvider)
        {
            #region XML Payload generated

            /*
             *  <Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName=".NET Library"
             *      xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
             *      <Actions>
             *          <SetProperty Id="1042" ObjectPathId="1038" Name="Required">
             *              <Parameter Type="Boolean">true</Parameter>
             *          </SetProperty>
             *          <Method Name="Update" Id="1043" ObjectPathId="82">
             *              <Parameters>
             *                  <Parameter Type="Boolean">true</Parameter>
             *              </Parameters>
             *          </Method>
             *      </Actions>
             *      <ObjectPaths>
             *          <Identity Id="1038" Name="88be0da0-204d-3000-7e87-438991c722f3|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:b56adf79-ff6a-4964-a63a-ff1fa23be9f8:web:8c8e101c-1b0d-4253-85e7-c30039bf46e2:contenttype:0x01007D2D52B86CBD804BA6D9F006DF19F8DC:fl:4d4fbc21-ecf7-40e4-b42b-d23b6c854789" />
             *          <Identity Id="82" Name="87be0da0-1066-3000-787b-4a007d7fdced|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:b56adf79-ff6a-4964-a63a-ff1fa23be9f8:web:8c8e101c-1b0d-4253-85e7-c30039bf46e2:contenttype:0x01007D2D52B86CBD804BA6D9F006DF19F8DC" />
             *      </ObjectPaths>
             *  </Request>
             */
            #endregion

            int fieldLinkIdentityId   = idProvider.GetActionId();
            int contentTypeIdentityId = idProvider.GetActionId();

            List <ActionObjectPath> actions = new List <ActionObjectPath>();

            foreach (PropertyDescriptor cp in (FieldLink as FieldLink).ChangedProperties)
            {
                ActionObjectPath objectPathForChangedProperty = new ActionObjectPath
                {
                    Action = new SetPropertyAction
                    {
                        Id           = idProvider.GetActionId(),
                        ObjectPathId = fieldLinkIdentityId.ToString(),
                        Name         = cp.Name,
                        SetParameter = new Parameter
                        {
                            Type  = cp.PropertyType.Name,
                            Value = cp.GetValue(FieldLink)
                        }
                    }
                };
                actions.Add(objectPathForChangedProperty);
            }

            ActionObjectPath updateMethod = new ActionObjectPath
            {
                Action = new MethodAction
                {
                    Name         = "Update",
                    ObjectPathId = contentTypeIdentityId.ToString(),
                    Id           = idProvider.GetActionId(),
                    Parameters   = new List <Parameter>()
                    {
                        new Parameter
                        {
                            Type  = "Boolean",
                            Value = IsListField ? false : UpdateContentType
                        }
                    }
                }
            };

            ActionObjectPath contentTypeIdentity = new ActionObjectPath
            {
                ObjectPath = new Identity
                {
                    Id   = contentTypeIdentityId,
                    Name = $"6ba80da0-b09a-3000-7e8f-67b158a69089|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:{ContentType.PnPContext.Site.Id}:web:{ContentType.PnPContext.Web.Id}:contenttype:{ContentType.StringId}"
                }
            };

            ActionObjectPath fieldLinkIdentity = new ActionObjectPath
            {
                ObjectPath = new Identity
                {
                    Id   = fieldLinkIdentityId,
                    Name = $"6ba80da0-b09a-3000-7e8f-67b158a69089|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:{ContentType.PnPContext.Site.Id}:web:{ContentType.PnPContext.Web.Id}:contenttype:{ContentType.StringId}:fl:{FieldLink.Id}"
                }
            };

            ActionObjectPath listContentTypeIdentity = null;
            ActionObjectPath listFieldLinkIdentity   = null;

            if (IsListField)
            {
                listContentTypeIdentity = new ActionObjectPath
                {
                    ObjectPath = new Identity
                    {
                        Id   = contentTypeIdentityId,
                        Name = $"6ba80da0-b09a-3000-7e8f-67b158a69089|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:{ContentType.PnPContext.Site.Id}:web:{ContentType.PnPContext.Web.Id}:list:{List.Id}:contenttype:{ContentType.StringId}"
                    }
                };

                listFieldLinkIdentity = new ActionObjectPath
                {
                    ObjectPath = new Identity
                    {
                        Id   = fieldLinkIdentityId,
                        Name = $"6ba80da0-b09a-3000-7e8f-67b158a69089|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:{ContentType.PnPContext.Site.Id}:web:{ContentType.PnPContext.Web.Id}:list:{List.Id}:contenttype:{ContentType.StringId}:fl:{FieldLink.Id}"
                    }
                };
            }

            actions.Add(updateMethod);

            if (IsListField)
            {
                actions.Add(listContentTypeIdentity);
                actions.Add(listFieldLinkIdentity);
            }
            else
            {
                actions.Add(contentTypeIdentity);
                actions.Add(fieldLinkIdentity);
            }

            return(actions);
        }
        public List <ActionObjectPath> GetRequest(IIdProvider idProvider)
        {
            IdentityPath = idProvider.GetActionId();
            QueryIdPath  = idProvider.GetActionId();
            int updateId = idProvider.GetActionId();

            #region XML Payload generated

            /*
             * <Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="pnp core sdk"
             *  xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
             *  <Actions>
             *      <SetProperty Id="4" ObjectPathId="1" Name="AllowedDomainListForSyncClient">
             *          <Parameter Type="Array"></Parameter>
             *      </SetProperty>
             *      <SetProperty Id="5" ObjectPathId="1" Name="BlockMacSync">
             *          <Parameter Type="Boolean">false</Parameter>
             *      </SetProperty>
             *      <SetProperty Id="6" ObjectPathId="1" Name="ContentTypeSyncSiteTemplatesList">
             *          <Parameter Type="Array"></Parameter>
             *      </SetProperty>
             *      <SetProperty Id="7" ObjectPathId="1" Name="ExcludedFileExtensionsForSyncClient">
             *          <Parameter Type="Array">
             *              <Object Type="String"></Object>
             *          </Parameter>
             *      </SetProperty>
             *  </Actions>
             *  <ObjectPaths>
             *      <Method Id="3" ParentId="1" Name="Update" />
             *      <Identity Id="1" Name="e4d2fd9f-408c-3000-4ada-425ef57c66a4|908bed80-a04a-4433-b4a0-883d9847d110:6492ece7-7f5d-4499-8130-50e761e25bd9&#xA;Tenant" />
             *  </ObjectPaths>
             * </Request>
             */
            #endregion

            List <ActionObjectPath> actions = new List <ActionObjectPath>();

            var fieldsToUpdate = GetFieldsToUpdate();
            foreach (var field in fieldsToUpdate)
            {
                ActionObjectPath updateProperty = new ActionObjectPath()
                {
                    Action = new SetPropertyAction()
                    {
                        Id           = idProvider.GetActionId(),
                        ObjectPathId = IdentityPath.ToString(),
                        Name         = field.FieldName,
                        SetParameter = new Parameter()
                        {
                            Type  = field.FieldType,
                            Value = field.FieldValue
                        }
                    }
                };

                actions.Add(updateProperty);
            }

            ActionObjectPath updateSitePropertiesAction = new ActionObjectPath()
            {
                ObjectPath = new ObjectPathMethod()
                {
                    Id       = updateId,
                    ParentId = IdentityPath,
                    Name     = "Update"
                }
            };

            ActionObjectPath updateSitePropertiesIdentity = new ActionObjectPath()
            {
                ObjectPath = new Identity()
                {
                    Id   = IdentityPath,
                    Name = Properties.ObjectIdentity.Replace("\n", "&#xA;")
                }
            };

            actions.Add(updateSitePropertiesAction);
            actions.Add(updateSitePropertiesIdentity);

            return(actions);
        }