예제 #1
0
        /// <summary>
        /// For backward compatibility with old wrappers.
        /// </summary>
        public void SetNotificationPreferences(ApplicationDeliveryPreferencesType ApplicationDeliveryPreferences, List <NotificationEnableType> UserDeliveryPreferenceList)
        {
            this.ApplicationDeliveryPreferences = ApplicationDeliveryPreferences;
            this.UserDeliveryPreferenceList     = UserDeliveryPreferenceList;

            Execute();
        }
예제 #2
0
        public void SetNotificationPreferences()
        {
            Assert.IsNotNull(TestData.NotificationPreferencesResponse);
            ApplicationDeliveryPreferencesType appPref = TestData.NotificationPreferencesResponse.ApplicationDeliveryPreferences;

            appPref.NotificationPayloadType = NotificationPayloadTypeCodeType.eBLSchemaSOAP;
            NotificationEnableTypeCollection userPref = TestData.NotificationPreferencesResponse.UserDeliveryPreferenceArray;
            SetNotificationPreferencesCall   api      = new SetNotificationPreferencesCall(this.apiContext);

            api.ApplicationDeliveryPreferences = appPref;
            api.UserDeliveryPreferenceList     = userPref;
            // Make API call.
            ApiException gotException = null;

            try
            {
                api.Execute();
            }
            catch (ApiException ex)
            {
                gotException = ex;
            }
            if (gotException != null)
            {
                Assert.IsTrue(appPref == null && userPref == null);
            }
        }
예제 #3
0
        /// <summary>
        /// Manages notification and alert preferences for applications and users.
        /// </summary>
        ///
        /// <param name="ApplicationDeliveryPreferences">
        /// Specifies application-level event preferences that have been enabled,
        /// including the URL to which notifications should be delivered and whether
        /// notifications should be enabled or disabled (although the
        /// <b>UserDeliveryPreferenceArray</b> input property specifies specific
        /// notification subscriptions).
        /// </param>
        ///
        /// <param name="UserDeliveryPreferenceList">
        /// Specifies events and whether or not they are enabled.
        /// </param>
        ///
        /// <param name="UserData">
        /// Specifies user data for notification settings, such as mobile phone number.
        /// </param>
        ///
        /// <param name="EventPropertyList">
        /// Characteristics or details of an event such as type, name and value.
        /// Currently can only be set for wireless applications.
        /// </param>
        ///
        /// <param name="DeliveryURLName">
        /// Specifies up to 25 ApplicationDeliveryPreferences.DeliveryURLDetails.DeliveryURLName to associate with a user token sent in a SetNotificationPreferences request. To specify multiple DeliveryURLNames, create separate instances of ApplicationDeliveryPreferences.DeliveryURLDetails.DeliveryURLName, and then enable up to 25 DeliveryURLNames by including them in comma-separated format in this field.
        /// </param>
        ///
        public void SetNotificationPreferences(ApplicationDeliveryPreferencesType ApplicationDeliveryPreferences, List <NotificationEnableType> UserDeliveryPreferenceList, NotificationUserDataType UserData, List <NotificationEventPropertyType> EventPropertyList, string DeliveryURLName)
        {
            this.ApplicationDeliveryPreferences = ApplicationDeliveryPreferences;
            this.UserDeliveryPreferenceList     = UserDeliveryPreferenceList;
            this.UserData          = UserData;
            this.EventPropertyList = EventPropertyList;
            this.DeliveryURLName   = DeliveryURLName;

            Execute();
        }
		/// <summary>
		/// Manages notification and alert preferences for applications and users.
		/// </summary>
		/// 
		/// <param name="ApplicationDeliveryPreferences">
		/// Specifies application-level event preferences that have been enabled,
		/// including the URL to which notifications should be delivered and whether
		/// notifications should be enabled or disabled (although the
		/// UserDeliveryPreferenceArray input property specifies specific
		/// notification subscriptions).
		/// </param>
		///
		/// <param name="UserDeliveryPreferenceList">
		/// Specifies events and whether or not they are enabled.
		/// </param>
		///
		/// <param name="UserData">
		/// Specifies user data for notification settings, such as mobile phone number.
		/// </param>
		///
		/// <param name="EventPropertyList">
		/// Characteristics or details of an event such as type, name and value.
		/// Currently can only be set for wireless applications.
		/// </param>
		///
		/// <param name="DeliveryURLName">
		/// Specifies up to 25 ApplicationDeliveryPreferences.DeliveryURLDetails.DeliveryURLName
		/// to associate with a user token sent in a SetNotificationPreferences request. To
		/// specify multiple DeliveryURLNames, create separate instances of
		/// ApplicationDeliveryPreferences.DeliveryURLDetails.DeliveryURLName, and then enable
		/// up to 25 DeliveryURLNames by including them in comma-separated format in this field.
		/// </param>
		///
		public void SetNotificationPreferences(ApplicationDeliveryPreferencesType ApplicationDeliveryPreferences, NotificationEnableTypeCollection UserDeliveryPreferenceList, NotificationUserDataType UserData, NotificationEventPropertyTypeCollection EventPropertyList, string DeliveryURLName)
		{
			this.ApplicationDeliveryPreferences = ApplicationDeliveryPreferences;
			this.UserDeliveryPreferenceList = UserDeliveryPreferenceList;
			this.UserData = UserData;
			this.EventPropertyList = EventPropertyList;
			this.DeliveryURLName = DeliveryURLName;

			Execute();
			
		}
예제 #5
0
        public IHttpActionResult SetNotificationPreferences()
        {
            try
            {
                apiContext = GetApiContext();

                SetNotificationPreferencesCall     call     = new SetNotificationPreferencesCall(apiContext);
                ApplicationDeliveryPreferencesType delivery = new ApplicationDeliveryPreferencesType();
                delivery.AlertEnable                = EnableCodeType.Enable;
                delivery.AlertEmail                 = "mailto://[email protected]";
                delivery.ApplicationEnable          = EnableCodeType.Enable;
                delivery.ApplicationURL             = "XXXXXXX/api/main/GetEbayNotification";
                delivery.AlertEnableSpecified       = true;
                delivery.ApplicationEnableSpecified = true;
                delivery.DeviceType                 = DeviceTypeCodeType.Platform;
                delivery.DeviceTypeSpecified        = true;

                NotificationEnableType notification =
                    new NotificationEnableType
                {
                    EventEnable          = EnableCodeType.Enable,
                    EventEnableSpecified = true,
                    EventType            = NotificationEventTypeCodeType.BidReceived,
                    EventTypeSpecified   = true
                };

                NotificationEnableType notification2 =
                    new NotificationEnableType
                {
                    EventEnable          = EnableCodeType.Enable,
                    EventEnableSpecified = true,
                    EventType            = NotificationEventTypeCodeType.BestOffer,
                    EventTypeSpecified   = true
                };

                NotificationEnableType notification3 =
                    new NotificationEnableType
                {
                    EventEnable          = EnableCodeType.Enable,
                    EventEnableSpecified = true,
                    EventType            = NotificationEventTypeCodeType.AskSellerQuestion,
                    EventTypeSpecified   = true
                };

                call.SetNotificationPreferences(delivery, new NotificationEnableTypeCollection(new[] { notification, notification2, notification3 }));

                return(Ok());
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #6
0
        /*
         * // Messages...
         * list.Add(});
         * list.Add(new NotificationEnableType { EventType = NotificationEventTypeCodeType.MyMessageseBayMessage, EventEnable = EnableCodeType.Enable });
         * list.Add(new NotificationEnableType { EventType = NotificationEventTypeCodeType.MyMessagesM2MMessage, EventEnable = EnableCodeType.Enable });
         *
         * // Feedback
         * list.Add(new NotificationEnableType { EventType = NotificationEventTypeCodeType.FeedbackReceived, EventEnable = EnableCodeType.Enable });
         * // FeedbackStarChanged
         *
         * // Sales
         *
         * list.Add(new NotificationEnableType { EventType = NotificationEventTypeCodeType.AuctionCheckoutComplete, EventEnable = EnableCodeType.Enable });
         * list.Add(new NotificationEnableType { EventType = NotificationEventTypeCodeType.BestOffer, EventEnable = EnableCodeType.Enable });
         * list.Add(new NotificationEnableType { EventType = NotificationEventTypeCodeType.BidReceived, EventEnable = EnableCodeType.Enable });
         * list.Add(new NotificationEnableType { EventType = NotificationEventTypeCodeType.FixedPriceTransaction, EventEnable = EnableCodeType.Enable });
         * // ItemSold == Only shown when a purchase happens and it ends the listing. The FixedPriceTransaction also occurs.
         * list.Add(new NotificationEnableType { EventType = NotificationEventTypeCodeType.ItemMarkedPaid, EventEnable = EnableCodeType.Enable });
         *
         *
         * // Listings Ended
         * list.Add(new NotificationEnableType { EventType = NotificationEventTypeCodeType.ItemSuspended, EventEnable = EnableCodeType.Enable });
         * list.Add(new NotificationEnableType { EventType = NotificationEventTypeCodeType.ItemClosed, EventEnable = EnableCodeType.Enable });
         * list.Add(new NotificationEnableType { EventType = NotificationEventTypeCodeType.ItemUnsold, EventEnable = EnableCodeType.Enable });
         *
         *
         * // Request Totals
         * list.Add(new NotificationEnableType { EventType = NotificationEventTypeCodeType.CheckoutBuyerRequestsTotal, EventEnable = EnableCodeType.Enable });
         *
         * // Disputes
         * list.Add(new NotificationEnableType { EventType = NotificationEventTypeCodeType.BuyerResponseDispute, EventEnable = EnableCodeType.Enable });
         * // INRBuyerClosedDispute
         * // INRBuyerOpenedDispute
         * // INRBuyerRespondedToDispute
         * //
         *
         * // WTF
         * list.Add(new NotificationEnableType { EventType = NotificationEventTypeCodeType.TokenRevocation, EventEnable = EnableCodeType.Enable });
         * list.Add(new NotificationEnableType { EventType = NotificationEventTypeCodeType.UserIDChanged, EventEnable = EnableCodeType.Enable });
         */

        protected override void ExecuteInternal()
        {
            ApiContext apiContext = this.ApiContext;
            SetNotificationPreferencesCall apiCall = new SetNotificationPreferencesCall(apiContext);

            // Application Delivery Preferences
            {
                ApplicationDeliveryPreferencesType applicationDeliveryPreferences = new ApplicationDeliveryPreferencesType();
                applicationDeliveryPreferences.ApplicationEnable = EnableCodeType.Enable;

                applicationDeliveryPreferences.DeviceType = DeviceTypeCodeType.ClientAlerts;

                applicationDeliveryPreferences.AlertEnable = EnableCodeType.Disable;

                apiCall.ApplicationDeliveryPreferences = applicationDeliveryPreferences;
            }

            // UserDeliveryPreferenceList
            {
                apiCall.UserDeliveryPreferenceList = new NotificationEnableTypeCollection();

                foreach (NotificationPreference item in this.NotificationPreferences)
                {
                    if (item.Dirty)
                    {
                        NotificationEnableType enableType = new NotificationEnableType()
                        {
                            EventType   = item.EventType,
                            EventEnable = item.Enabled ? EnableCodeType.Enable : EnableCodeType.Disable
                        };

                        apiCall.UserDeliveryPreferenceList.Add(enableType);
                    }
                }
            }

            apiCall.Execute();

            foreach (NotificationPreference item in this.NotificationPreferences)
            {
                item.Dirty = false;
            }
        }
예제 #7
0
 /// <summary>
 /// For backward compatibility with old wrappers.
 /// </summary>
 public void SetNotificationPreferences(ApplicationDeliveryPreferencesType ApplicationDeliveryPreferences)
 {
     this.ApplicationDeliveryPreferences = ApplicationDeliveryPreferences;
     Execute();
 }
        /// <summary>
        /// For backward compatibility with old wrappers.
        /// </summary>
        public void SetNotificationPreferences(ApplicationDeliveryPreferencesType ApplicationDeliveryPreferences, NotificationEnableTypeCollection UserDeliveryPreferenceList)
        {
            this.ApplicationDeliveryPreferences = ApplicationDeliveryPreferences;
            this.UserDeliveryPreferenceList = UserDeliveryPreferenceList;

            Execute();
        }
 /// <summary>
 /// For backward compatibility with old wrappers.
 /// </summary>
 public void SetNotificationPreferences(ApplicationDeliveryPreferencesType ApplicationDeliveryPreferences)
 {
     this.ApplicationDeliveryPreferences = ApplicationDeliveryPreferences;
     Execute();
 }