| 1 | package location |
| 2 | |
| 3 | import ( |
| 4 | "github.com/denverdino/aliyungo/common" |
| 5 | ) |
| 6 | |
| 7 | type DescribeEndpointArgs struct { |
| 8 | Id common.Region |
| 9 | ServiceCode string |
| 10 | Type string |
| 11 | } |
| 12 | |
| 13 | type EndpointItem struct { |
| 14 | Protocols struct { |
| 15 | Protocols []string |
| 16 | } |
| 17 | Type string |
| 18 | Namespace string |
| 19 | Id common.Region |
| 20 | SerivceCode string |
| 21 | Endpoint string |
| 22 | } |
| 23 | |
| 24 | type DescribeEndpointResponse struct { |
| 25 | common.Response |
| 26 | EndpointItem |
| 27 | } |
| 28 | |
| 29 | func (client *Client) DescribeEndpoint(args *DescribeEndpointArgs) (*DescribeEndpointResponse, error) { |
| 30 | response := &DescribeEndpointResponse{} |
| 31 | err := client.Invoke("DescribeEndpoint", args, response) |
| 32 | if err != nil { |
| 33 | return nil, err |
| 34 | } |
| 35 | return response, err |
| 36 | } |
| 37 | |
| 38 | type DescribeEndpointsArgs struct { |
| 39 | Id common.Region |
| 40 | ServiceCode string |
| 41 | Type string |
| 42 | } |
| 43 | |
| 44 | type DescribeEndpointsResponse struct { |
| 45 | common.Response |
| 46 | Endpoints struct { |
| 47 | Endpoint []EndpointItem |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | func (client *Client) DescribeEndpoints(args *DescribeEndpointsArgs) (*DescribeEndpointsResponse, error) { |
| 52 | response := &DescribeEndpointsResponse{} |
| 53 | err := client.Invoke("DescribeEndpoints", args, response) |
| 54 | if err != nil { |
| 55 | return nil, err |
| 56 | } |
| 57 | return response, err |
| 58 | } |