public static AliasDeviceListResult fromResponse(ResponseWrapper responseWrapper)
 {
     AliasDeviceListResult aliasDeviceListResult = new AliasDeviceListResult();
     if (responseWrapper.isServerResponse())
     {
         aliasDeviceListResult = JsonConvert.DeserializeObject<AliasDeviceListResult>(responseWrapper.responseContent);
     }
     aliasDeviceListResult.ResponseResult = responseWrapper;
     return aliasDeviceListResult;
 }
        public static AliasDeviceListResult fromResponse(ResponseWrapper responseWrapper)
        {
            AliasDeviceListResult aliasDeviceListResult = new AliasDeviceListResult();

            if (responseWrapper.isServerResponse())
            {
                aliasDeviceListResult = JsonConvert.DeserializeObject <AliasDeviceListResult>(responseWrapper.responseContent);
            }
            aliasDeviceListResult.ResponseResult = responseWrapper;
            return(aliasDeviceListResult);
        }
Exemple #3
0
        // ------------- alias

        public AliasDeviceListResult getAliasDeviceList(String alias, String platform)
        {
            String url = HOST_NAME_SSL + ALIASES_PATH + "/" + alias;

            if (null != platform)
            {
                url += "?platform=" + platform;
            }
            ResponseWrapper response = this.sendGet(url, Authorization(), null);

            return(AliasDeviceListResult.fromResponse(response));
        }
Exemple #4
0
        // ------------- alias
        //GET /v3/aliases/{alias_value}
        //查询别名 (与设备的绑定关系)
        public AliasDeviceListResult getAliasDeviceList(String alias, String platform)
        {
            Preconditions.checkArgument(!String.IsNullOrEmpty(alias), "alias should be set");
            Preconditions.checkArgument(StringUtil.IsValidAlias(alias), "the alias should be the right format");
            String url = HOST_NAME_SSL + ALIASES_PATH + "/" + alias;

            if (null != platform)
            {
                url += "?platform=" + platform;
            }
            ResponseWrapper response = this.sendGet(url, Authorization(), null);

            return(AliasDeviceListResult.fromResponse(response));
        }
Exemple #5
0
        public AliasDeviceListResult getAliasDeviceList(
            string alias,
            string platform)
        {
            Preconditions.checkArgument(!string.IsNullOrEmpty(alias), (object)"alias should be set");
            Preconditions.checkArgument(StringUtil.IsValidAlias(alias), (object)"alias should be the right format");
            string url = "https://device.jpush.cn/v3/aliases/" + alias;

            if (platform != null)
            {
                url = url + "?platform=" + platform;
            }
            return(AliasDeviceListResult.fromResponse(this.sendGet(url, this.Authorization(), (string)null)));
        }