|
| 1 | +// This file is auto-generated, don't edit it. Thanks. |
| 2 | +/** |
| 3 | + * |
| 4 | + */ |
| 5 | +package ats_1_0 |
| 6 | + |
| 7 | +import ( |
| 8 | + openapi "github.com/alibabacloud-go/darabonba-openapi/client" |
| 9 | + openapiutil "github.com/alibabacloud-go/openapi-util/service" |
| 10 | + util "github.com/alibabacloud-go/tea-utils/service" |
| 11 | + "github.com/alibabacloud-go/tea/tea" |
| 12 | +) |
| 13 | + |
| 14 | +type GetJobAuthHeaders struct { |
| 15 | + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` |
| 16 | + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` |
| 17 | +} |
| 18 | + |
| 19 | +func (s GetJobAuthHeaders) String() string { |
| 20 | + return tea.Prettify(s) |
| 21 | +} |
| 22 | + |
| 23 | +func (s GetJobAuthHeaders) GoString() string { |
| 24 | + return s.String() |
| 25 | +} |
| 26 | + |
| 27 | +func (s *GetJobAuthHeaders) SetCommonHeaders(v map[string]*string) *GetJobAuthHeaders { |
| 28 | + s.CommonHeaders = v |
| 29 | + return s |
| 30 | +} |
| 31 | + |
| 32 | +func (s *GetJobAuthHeaders) SetXAcsDingtalkAccessToken(v string) *GetJobAuthHeaders { |
| 33 | + s.XAcsDingtalkAccessToken = &v |
| 34 | + return s |
| 35 | +} |
| 36 | + |
| 37 | +type GetJobAuthRequest struct { |
| 38 | + OpUserId *string `json:"opUserId,omitempty" xml:"opUserId,omitempty"` |
| 39 | +} |
| 40 | + |
| 41 | +func (s GetJobAuthRequest) String() string { |
| 42 | + return tea.Prettify(s) |
| 43 | +} |
| 44 | + |
| 45 | +func (s GetJobAuthRequest) GoString() string { |
| 46 | + return s.String() |
| 47 | +} |
| 48 | + |
| 49 | +func (s *GetJobAuthRequest) SetOpUserId(v string) *GetJobAuthRequest { |
| 50 | + s.OpUserId = &v |
| 51 | + return s |
| 52 | +} |
| 53 | + |
| 54 | +type GetJobAuthResponseBody struct { |
| 55 | + // 职位ID |
| 56 | + JobId *string `json:"jobId,omitempty" xml:"jobId,omitempty"` |
| 57 | + // 职位负责人 |
| 58 | + JobOwners []*GetJobAuthResponseBodyJobOwners `json:"jobOwners,omitempty" xml:"jobOwners,omitempty" type:"Repeated"` |
| 59 | +} |
| 60 | + |
| 61 | +func (s GetJobAuthResponseBody) String() string { |
| 62 | + return tea.Prettify(s) |
| 63 | +} |
| 64 | + |
| 65 | +func (s GetJobAuthResponseBody) GoString() string { |
| 66 | + return s.String() |
| 67 | +} |
| 68 | + |
| 69 | +func (s *GetJobAuthResponseBody) SetJobId(v string) *GetJobAuthResponseBody { |
| 70 | + s.JobId = &v |
| 71 | + return s |
| 72 | +} |
| 73 | + |
| 74 | +func (s *GetJobAuthResponseBody) SetJobOwners(v []*GetJobAuthResponseBodyJobOwners) *GetJobAuthResponseBody { |
| 75 | + s.JobOwners = v |
| 76 | + return s |
| 77 | +} |
| 78 | + |
| 79 | +type GetJobAuthResponseBodyJobOwners struct { |
| 80 | + // 员工标识 |
| 81 | + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` |
| 82 | + // 员工姓名 |
| 83 | + Name *string `json:"name,omitempty" xml:"name,omitempty"` |
| 84 | +} |
| 85 | + |
| 86 | +func (s GetJobAuthResponseBodyJobOwners) String() string { |
| 87 | + return tea.Prettify(s) |
| 88 | +} |
| 89 | + |
| 90 | +func (s GetJobAuthResponseBodyJobOwners) GoString() string { |
| 91 | + return s.String() |
| 92 | +} |
| 93 | + |
| 94 | +func (s *GetJobAuthResponseBodyJobOwners) SetUserId(v string) *GetJobAuthResponseBodyJobOwners { |
| 95 | + s.UserId = &v |
| 96 | + return s |
| 97 | +} |
| 98 | + |
| 99 | +func (s *GetJobAuthResponseBodyJobOwners) SetName(v string) *GetJobAuthResponseBodyJobOwners { |
| 100 | + s.Name = &v |
| 101 | + return s |
| 102 | +} |
| 103 | + |
| 104 | +type GetJobAuthResponse struct { |
| 105 | + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` |
| 106 | + Body *GetJobAuthResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` |
| 107 | +} |
| 108 | + |
| 109 | +func (s GetJobAuthResponse) String() string { |
| 110 | + return tea.Prettify(s) |
| 111 | +} |
| 112 | + |
| 113 | +func (s GetJobAuthResponse) GoString() string { |
| 114 | + return s.String() |
| 115 | +} |
| 116 | + |
| 117 | +func (s *GetJobAuthResponse) SetHeaders(v map[string]*string) *GetJobAuthResponse { |
| 118 | + s.Headers = v |
| 119 | + return s |
| 120 | +} |
| 121 | + |
| 122 | +func (s *GetJobAuthResponse) SetBody(v *GetJobAuthResponseBody) *GetJobAuthResponse { |
| 123 | + s.Body = v |
| 124 | + return s |
| 125 | +} |
| 126 | + |
| 127 | +type Client struct { |
| 128 | + openapi.Client |
| 129 | +} |
| 130 | + |
| 131 | +func NewClient(config *openapi.Config) (*Client, error) { |
| 132 | + client := new(Client) |
| 133 | + err := client.Init(config) |
| 134 | + return client, err |
| 135 | +} |
| 136 | + |
| 137 | +func (client *Client) Init(config *openapi.Config) (_err error) { |
| 138 | + _err = client.Client.Init(config) |
| 139 | + if _err != nil { |
| 140 | + return _err |
| 141 | + } |
| 142 | + client.EndpointRule = tea.String("") |
| 143 | + if tea.BoolValue(util.Empty(client.Endpoint)) { |
| 144 | + client.Endpoint = tea.String("api.dingtalk.com") |
| 145 | + } |
| 146 | + |
| 147 | + return nil |
| 148 | +} |
| 149 | + |
| 150 | +func (client *Client) GetJobAuth(jobId *string, request *GetJobAuthRequest) (_result *GetJobAuthResponse, _err error) { |
| 151 | + runtime := &util.RuntimeOptions{} |
| 152 | + headers := &GetJobAuthHeaders{} |
| 153 | + _result = &GetJobAuthResponse{} |
| 154 | + _body, _err := client.GetJobAuthWithOptions(jobId, request, headers, runtime) |
| 155 | + if _err != nil { |
| 156 | + return _result, _err |
| 157 | + } |
| 158 | + _result = _body |
| 159 | + return _result, _err |
| 160 | +} |
| 161 | + |
| 162 | +func (client *Client) GetJobAuthWithOptions(jobId *string, request *GetJobAuthRequest, headers *GetJobAuthHeaders, runtime *util.RuntimeOptions) (_result *GetJobAuthResponse, _err error) { |
| 163 | + _err = util.ValidateModel(request) |
| 164 | + if _err != nil { |
| 165 | + return _result, _err |
| 166 | + } |
| 167 | + query := map[string]interface{}{} |
| 168 | + if !tea.BoolValue(util.IsUnset(request.OpUserId)) { |
| 169 | + query["opUserId"] = request.OpUserId |
| 170 | + } |
| 171 | + |
| 172 | + realHeaders := make(map[string]*string) |
| 173 | + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { |
| 174 | + realHeaders = headers.CommonHeaders |
| 175 | + } |
| 176 | + |
| 177 | + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { |
| 178 | + realHeaders["x-acs-dingtalk-access-token"] = headers.XAcsDingtalkAccessToken |
| 179 | + } |
| 180 | + |
| 181 | + req := &openapi.OpenApiRequest{ |
| 182 | + Headers: realHeaders, |
| 183 | + Query: openapiutil.Query(query), |
| 184 | + } |
| 185 | + _result = &GetJobAuthResponse{} |
| 186 | + _body, _err := client.DoROARequest(tea.String("GetJobAuth"), tea.String("ats_1.0"), tea.String("HTTP"), tea.String("GET"), tea.String("AK"), tea.String("/v1.0/ats/auths/jobs/"+tea.StringValue(jobId)), tea.String("json"), req, runtime) |
| 187 | + if _err != nil { |
| 188 | + return _result, _err |
| 189 | + } |
| 190 | + _err = tea.Convert(_body, &_result) |
| 191 | + return _result, _err |
| 192 | +} |
0 commit comments