示例#1
0
        /// <summary>
        /// The get operation is used to retrieve all customers accounts settings from the database.
        /// </summary>
        /// <returns></returns>
        public CustomerGetResponse Get()
        {
            XElement message =
                new XElement("customer",
                             new XElement("get",
                                          new XElement("filter"),
                                          new XElement("dataset",
                                                       new XElement("gen_info"),
                                                       new XElement("stat")
                                                       )
                                          )
                             );

            return(CustomerGetResponse.Parse(ApiHttpClient.SendPacket(message)));
        }
示例#2
0
        /// <summary>
        /// The get operation is used to retrieve customer account settings from the database.
        /// </summary>
        /// <param name="id">Specifies ID of a customer account.</param>
        /// <param name="login">Specifies login name of a customer account.</param>
        /// <param name="ownerId">Specifies ID of a customer account owner.</param>
        /// <param name="ownerLogin">Specifies login name of a customer account owner.</param>
        /// <param name="guid">Specifies the GUID of a customer account. For details on GUIDs, refer to the API RPC Protocol > GUIDs Overview section of Plesk API RPC Developer's Guide.</param>
        /// <param name="getGenInfo">Need to request for the general customer account settings.</param>
        /// <param name="getStat">Need to request statistics on the specified customers.</param>
        /// <returns></returns>
        public CustomerGetResponse Get(int?id = null, string login = null, int?ownerId = null, string ownerLogin = null, string guid = null, bool getGenInfo = true, bool getStat = false)
        {
            XElement message =
                new XElement("customer",
                             new XElement("get",
                                          new XElement("filter",
                                                       id.HasValue ?                            new XElement("id", id.Value) : null,
                                                       !String.IsNullOrWhiteSpace(login) ?      new XElement("login", login) : null,
                                                       ownerId.HasValue ?                       new XElement("owner-id", ownerId) : null,
                                                       !String.IsNullOrWhiteSpace(ownerLogin) ? new XElement("owner-login", ownerLogin) : null,
                                                       !String.IsNullOrWhiteSpace(guid) ?       new XElement("guid", guid) : null
                                                       ),
                                          new XElement("dataset",
                                                       getGenInfo ?    new XElement("gen_info") : null,
                                                       getStat ?       new XElement("stat") : null
                                                       )
                                          )
                             );

            return(CustomerGetResponse.Parse(ApiHttpClient.SendPacket(message)));
        }
示例#3
0
        public CustomerGetResponse CustomerGet(string login = "")
        {
            XElement message = new XElement("packet",
                                            new XAttribute("version", "1.6.7.0"),
                                            new XElement("customer",
                                                         new XElement("get",
                                                                      new XElement("filter",
                                                                                   new XElement("login", login)
                                                                                   ),
                                                                      new XElement("dataset",
                                                                                   new XElement("gen_info")
                                                                                   )
                                                                      )
                                                         )
                                            );

            HttpWebRequest request = ApiHttpClient.Request(message);
            XElement       resp    = ApiHttpClient.GetResponse(request);

            return(CustomerGetResponse.Parse(resp));
        }