Пример #1
0
        /// <summary>
        /// Delete this instance.
        /// </summary>
        /// <returns>The <see cref="T:FuelSDK.DeleteReturn"/> object..</returns>
        public DeleteReturn Delete()
        {
            ETDataExtension de = this;

            de.Fields = Columns;
            return(new DeleteReturn(de));
        }
 private void GetDataExtensionCustomerKey()
 {
     if (DataExtensionCustomerKey == null)
     {
         if (DataExtensionName == null)
         {
             throw new Exception("Unable to process ETDataExtensionRow request due to DataExtensionCustomerKey or DataExtensionName not being defined on ETDatExtensionRow");
         }
         var grDEName = new ETDataExtension
         {
             AuthStub     = AuthStub,
             Props        = new[] { "Name", "CustomerKey" },
             SearchFilter = new SimpleFilterPart {
                 Property = "Name", SimpleOperator = SimpleOperators.equals, Value = new[] { DataExtensionName }
             },
         }.Get();
         if (grDEName.Status && grDEName.Results.Length > 0)
         {
             DataExtensionCustomerKey = ((ETDataExtension)grDEName.Results[0]).CustomerKey;
         }
         else
         {
             throw new Exception("Unable to process ETDataExtensionRow request due to unable to find DataExtension based on DataExtensionName provided.");
         }
     }
 }
Пример #3
0
        /// <summary>
        /// Patch this instance.
        /// </summary>
        /// <returns>The <see cref="T:FuelSDK.PatchReturn"/> object..</returns>
        public PatchReturn Patch()
        {
            ETDataExtension de = this;

            de.Fields  = Columns;
            de.Columns = null;
            var pr = new PatchReturn(de);

            foreach (var rd in pr.Results)
            {
                ((ETDataExtension)rd.Object).Columns = (ETDataExtensionColumn[])((ETDataExtension)rd.Object).Fields;
                ((ETDataExtension)rd.Object).Fields  = null;
            }
            return(pr);
        }