| /* |
| Copyright 2017 Google Inc. |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| */ |
| |
| package common |
| |
| type RegionResponse struct { |
| Region string `json:"region"` |
| Host string `json:"host"` |
| } |
| |
| type Attribute struct { |
| Name string `json:"name"` |
| Value string `json:"value"` |
| } |
| |
| type VerifyAPIKeyRequest struct { |
| Key string `json:"apiKey"` |
| } |
| |
| type VerifyAPIKeyResponse struct { |
| Token string `json:"token"` |
| } |
| |
| type AnalyticsRecord struct { |
| ClientReceivedStartTimestamp int64 `json:"client_received_start_timestamp"` |
| ClientReceivedEndTimestamp int64 `json:"client_received_end_timestamp"` |
| ClientSentStartTimestamp int64 `json:"client_sent_start_timestamp"` |
| ClientSentEndTimestamp int64 `json:"client_sent_end_timestamp"` |
| TargetReceivedStartTimestamp int64 `json:"target_received_start_timestamp,omitempty"` |
| TargetReceivedEndTimestamp int64 `json:"target_received_end_timestamp,omitempty"` |
| TargetSentStartTimestamp int64 `json:"target_sent_start_timestamp,omitempty"` |
| TargetSentEndTimestamp int64 `json:"target_sent_end_timestamp,omitempty"` |
| RecordType string `json:"recordType"` |
| APIProxy string `json:"apiproxy"` |
| RequestURI string `json:"request_uri"` |
| RequestPath string `json:"request_path"` |
| RequestVerb string `json:"request_verb"` |
| ClientIP string `json:"client_ip,omitempty"` |
| UserAgent string `json:"useragent"` |
| APIProxyRevision int `json:"apiproxy_revision"` |
| ResponseStatusCode int `json:"response_status_code"` |
| DeveloperEmail string `json:"developer_email,omitempty"` |
| DeveloperApp string `json:"developer_app,omitempty"` |
| AccessToken string `json:"access_token,omitempty"` |
| ClientID string `json:"client_id,omitempty"` |
| APIProduct string `json:"api_product,omitempty"` |
| } |
| |
| type AnalyticsRequest struct { |
| Records []AnalyticsRecord `json:"records"` |
| } |
| |
| type AnalyticsResponse struct { |
| Accepted int `json:"accepted"` |
| Rejected int `json:"rejected"` |
| } |
| |
| type APIProduct struct { |
| APIResources []string `json:"apiResources"` |
| ApprovalType string `json:"approvalType"` |
| Attributes []Attribute `json:"attributes"` |
| CreatedAt int64 `json:"createdAt"` |
| CreatedBy string `json:"createdBy"` |
| Description string `json:"description"` |
| DisplayName string `json:"displayName"` |
| Environments []string `json:"environments"` |
| LastModifiedAt int64 `json:"lastModifiedAt"` |
| LastModifiedBy string `json:"lastModifiedBy"` |
| Name string `json:"name"` |
| Proxies []string `json:"proxies"` |
| Quota string `json:"quota"` |
| QuotaInterval string `json:"quotaInterval"` |
| QuotaTimeUnit string `json:"quotaTimeUnit"` |
| Scopes []string `json:"scopes"` |
| } |
| |
| type APIFaultMessage struct { |
| Fault APIFault `json:"fault"` |
| } |
| |
| type APIFault struct { |
| FaultString string `json:"faultstring"` |
| Detail APIFaultDetail `json:"detail"` |
| } |
| |
| type APIFaultDetail struct { |
| ErrorCode string `json:"errorcode"` |
| } |