get_portrayal.go 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. package cusanalytic_sc_online
  2. //Licensed under the Apache License, Version 2.0 (the "License");
  3. //you may not use this file except in compliance with the License.
  4. //You may obtain a copy of the License at
  5. //
  6. //http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. //Unless required by applicable law or agreed to in writing, software
  9. //distributed under the License is distributed on an "AS IS" BASIS,
  10. //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. //See the License for the specific language governing permissions and
  12. //limitations under the License.
  13. //
  14. // Code generated by Alibaba Cloud SDK Code Generator.
  15. // Changes may cause incorrect behavior and will be lost if the code is regenerated.
  16. import (
  17. "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
  18. "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
  19. )
  20. // GetPortrayal invokes the cusanalytic_sc_online.GetPortrayal API synchronously
  21. // api document: https://help.aliyun.com/api/cusanalytic_sc_online/getportrayal.html
  22. func (client *Client) GetPortrayal(request *GetPortrayalRequest) (response *GetPortrayalResponse, err error) {
  23. response = CreateGetPortrayalResponse()
  24. err = client.DoAction(request, response)
  25. return
  26. }
  27. // GetPortrayalWithChan invokes the cusanalytic_sc_online.GetPortrayal API asynchronously
  28. // api document: https://help.aliyun.com/api/cusanalytic_sc_online/getportrayal.html
  29. // asynchronous document: https://help.aliyun.com/document_detail/66220.html
  30. func (client *Client) GetPortrayalWithChan(request *GetPortrayalRequest) (<-chan *GetPortrayalResponse, <-chan error) {
  31. responseChan := make(chan *GetPortrayalResponse, 1)
  32. errChan := make(chan error, 1)
  33. err := client.AddAsyncTask(func() {
  34. defer close(responseChan)
  35. defer close(errChan)
  36. response, err := client.GetPortrayal(request)
  37. if err != nil {
  38. errChan <- err
  39. } else {
  40. responseChan <- response
  41. }
  42. })
  43. if err != nil {
  44. errChan <- err
  45. close(responseChan)
  46. close(errChan)
  47. }
  48. return responseChan, errChan
  49. }
  50. // GetPortrayalWithCallback invokes the cusanalytic_sc_online.GetPortrayal API asynchronously
  51. // api document: https://help.aliyun.com/api/cusanalytic_sc_online/getportrayal.html
  52. // asynchronous document: https://help.aliyun.com/document_detail/66220.html
  53. func (client *Client) GetPortrayalWithCallback(request *GetPortrayalRequest, callback func(response *GetPortrayalResponse, err error)) <-chan int {
  54. result := make(chan int, 1)
  55. err := client.AddAsyncTask(func() {
  56. var response *GetPortrayalResponse
  57. var err error
  58. defer close(result)
  59. response, err = client.GetPortrayal(request)
  60. callback(response, err)
  61. result <- 1
  62. })
  63. if err != nil {
  64. defer close(result)
  65. callback(nil, err)
  66. result <- 0
  67. }
  68. return result
  69. }
  70. // GetPortrayalRequest is the request struct for api GetPortrayal
  71. type GetPortrayalRequest struct {
  72. *requests.RpcRequest
  73. Date string `position:"Body" name:"Date"`
  74. LocationIds string `position:"Body" name:"LocationIds"`
  75. StoreIds string `position:"Body" name:"StoreIds"`
  76. }
  77. // GetPortrayalResponse is the response struct for api GetPortrayal
  78. type GetPortrayalResponse struct {
  79. *responses.BaseResponse
  80. FemalePercent float64 `json:"FemalePercent" xml:"FemalePercent"`
  81. Mcount int64 `json:"Mcount" xml:"Mcount"`
  82. Mcount1120 int64 `json:"Mcount1120" xml:"Mcount1120"`
  83. Newcount int64 `json:"Newcount" xml:"Newcount"`
  84. Agecount3140Percent float64 `json:"Agecount3140Percent" xml:"Agecount3140Percent"`
  85. Agecount4150Percent float64 `json:"Agecount4150Percent" xml:"Agecount4150Percent"`
  86. Agecount010Percent float64 `json:"Agecount010Percent" xml:"Agecount010Percent"`
  87. Fcount5160 int64 `json:"Fcount5160" xml:"Fcount5160"`
  88. Mcount010 int64 `json:"Mcount010" xml:"Mcount010"`
  89. Mcountgt60 int64 `json:"Mcountgt60" xml:"Mcountgt60"`
  90. Agecount1120Percent float64 `json:"Agecount1120Percent" xml:"Agecount1120Percent"`
  91. Fcountgt60 int64 `json:"Fcountgt60" xml:"Fcountgt60"`
  92. Fcount4150 int64 `json:"Fcount4150" xml:"Fcount4150"`
  93. Oldcount int64 `json:"Oldcount" xml:"Oldcount"`
  94. Fcount3140 int64 `json:"Fcount3140" xml:"Fcount3140"`
  95. Fcount2130 int64 `json:"Fcount2130" xml:"Fcount2130"`
  96. Agecountgt60Percent float64 `json:"Agecountgt60Percent" xml:"Agecountgt60Percent"`
  97. Fcount1120 int64 `json:"Fcount1120" xml:"Fcount1120"`
  98. OldcountPercent float64 `json:"OldcountPercent" xml:"OldcountPercent"`
  99. Mcount4150 int64 `json:"Mcount4150" xml:"Mcount4150"`
  100. Fcount int64 `json:"Fcount" xml:"Fcount"`
  101. NewcountPercent float64 `json:"NewcountPercent" xml:"NewcountPercent"`
  102. Mcount2130 int64 `json:"Mcount2130" xml:"Mcount2130"`
  103. Mcount3140 int64 `json:"Mcount3140" xml:"Mcount3140"`
  104. Agecount5160Percent float64 `json:"Agecount5160Percent" xml:"Agecount5160Percent"`
  105. Agecount2130Percent float64 `json:"Agecount2130Percent" xml:"Agecount2130Percent"`
  106. Fcount010 int64 `json:"Fcount010" xml:"Fcount010"`
  107. Mcount5160 int64 `json:"Mcount5160" xml:"Mcount5160"`
  108. MalePercent float64 `json:"MalePercent" xml:"MalePercent"`
  109. }
  110. // CreateGetPortrayalRequest creates a request to invoke GetPortrayal API
  111. func CreateGetPortrayalRequest() (request *GetPortrayalRequest) {
  112. request = &GetPortrayalRequest{
  113. RpcRequest: &requests.RpcRequest{},
  114. }
  115. request.InitWithApiInfo("cusanalytic_sc_online", "2019-05-24", "GetPortrayal", "", "")
  116. return
  117. }
  118. // CreateGetPortrayalResponse creates a response to parse from GetPortrayal response
  119. func CreateGetPortrayalResponse() (response *GetPortrayalResponse) {
  120. response = &GetPortrayalResponse{
  121. BaseResponse: &responses.BaseResponse{},
  122. }
  123. return
  124. }