/
response.go
executable file
·43 lines (36 loc) · 5.83 KB
/
response.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* GMO Aozora Net Bank Open API
*
* <p>オープンAPI仕様書(PDF版)は下記リンクをご参照ください</p> <div> <div style='display:inline-block;'><a style='text-decoration:none; font-weight:bold; color:#00b8d4;' href='https://gmo-aozora.com/business/service/api-specification.html' target='_blank'>オープンAPI仕様書</a></div><div style='display:inline-block; margin-left:2px; left:2px; width:10px; height:10px; border-top:2px solid #00b8d4; border-right:2px solid #00b8d4; transparent;-webkit-transform:rotate(45deg); transform: rotate(45deg);'></div> </div> <h4 style='margin-top:30px; border-left: solid 4px #1B2F48; padding: 0.1em 0.5em; color:#1B2F48;'>共通仕様</h4> <div style='width:100%; margin:10px;'> <p style='font-weight:bold; color:#616161;'><HTTPリクエストヘッダ></p> <div style='display:table; margin-left:10px; background-color:#29659b;'> <div style='display:table-cell; min-width:130px; padding:9px; border:1px solid #fff; color:#fff;'>項目</div> <div style='display:table-cell; width:85%; padding:9px; border:1px solid #fff; color:#fff;'>仕様</div> </div> <div style='display:table; margin-left:10px;'> <div style='display:table-cell; min-width:130px; padding:9px; border:1px solid #fff; color:#fff; background-color:#29659b;'>プロトコル</div> <div style='display:table-cell; width:85%; padding:9px; border:1px solid #fff; background-color:#f8f8f8;'>HTTP1.1/HTTPS</div> </div> <div style='display:table; margin-left:10px;'> <div style='display:table-cell; min-width:130px; padding:9px; border:1px solid #fff; color:#fff; background-color:#29659b;'>charset</div> <div style='display:table-cell; width:85%; padding:9px; border:1px solid #fff; background-color:#f8f8f8;'>UTF-8</div> </div> <div style='display:table; margin-left:10px;'> <div style='display:table-cell; min-width:130px; padding:9px; border:1px solid #fff; color:#fff; background-color:#29659b;'>content-type</div> <div style='display:table-cell; width:85%; padding:9px; border:1px solid #fff; background-color:#f8f8f8;'>application/json</div> </div> <div style='display:table; margin-left:10px;'> <div style='display:table-cell; min-width:130px; padding:9px; border:1px solid #fff; color:#fff; background-color:#29659b;'>domain_name</div> <div style='display:table-cell; width:85%; padding:9px; border:1px solid #fff; background-color:#f8f8f8;'> 本番環境:api.gmo-aozora.com</br> 開発環境:stg-api.gmo-aozora.com </div> </div> <div style='display:table; margin-left:10px;'> <div style='display:table-cell; min-width:130px; padding:9px; border:1px solid #fff; color:#fff; background-color:#29659b;'>メインURL</div> <div style='display:table-cell; width:85%; padding:9px; border:1px solid #fff; background-color:#f8f8f8;'> https://{domain_name}/ganb/api/personal/{version}</br> <span style='border-bottom:solid 1px;'>Version:1.x.x</span> の場合</br> https://api.gmo-aozora.com/ganb/api/personal/<span style='border-bottom:solid 1px;'>v1</span> </div> </div> </div> <div style='margin:20px 10px;'> <p style='font-weight:bold; color:#616161;'><リクエスト共通仕様></p> <p style='padding-left:20px; font-weight:bold; color:#616161;'>NULLデータの扱い</p> <p style='padding-left:40px;'>パラメータの値が空の場合、またはパラメータ自体が設定されていない場合、どちらもNULLとして扱います</p> </div> <div style='margin:20px 10px;'> <p style='font-weight:bold; color:#616161;'><レスポンス共通仕様></p> <p style='padding-left:20px; font-weight:bold; color:#616161;'>NULLデータの扱い</p> <ul> <li>レスポンスデータ</li> <ul> <li style='list-style-type:none;'>レスポンスデータの値が空の場合または、レスポンスデータ自体が設定されない場合は「項目自体を設定しません」と記載</li> </ul> <li>配列</li> <ul> <li style='list-style-type:none;'>配列の要素の値が空の場合は「空のリスト」と記載</li> <li style='list-style-type:none;'>配列自体が設定されない場合は「項目自体を設定しません」と記載</li> </ul> </ul> </div> <div style='margin:20px 10px;'> <p style='font-weight:bold; color:#616161;'><更新系APIに関する注意事項></p> <ul> <li style='list-style-type:none;'>更新系処理がタイムアウトとなった場合、処理自体は実行されている可能性がありますので、</li> <li style='list-style-type:none;'>再実行を行う必要がある場合は必ず照会系の処理で実行状況を確認してから再実行を行ってください</li> </ul> </div>
*
* API version: 1.1.12
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
import (
"net/http"
)
type APIResponse struct {
*http.Response `json:"-"`
Message string `json:"message,omitempty"`
// Operation is the name of the swagger operation.
Operation string `json:"operation,omitempty"`
// RequestURL is the request URL. This value is always available, even if the
// embedded *http.Response is nil.
RequestURL string `json:"url,omitempty"`
// Method is the HTTP method used for the request. This value is always
// available, even if the embedded *http.Response is nil.
Method string `json:"method,omitempty"`
// Payload holds the contents of the response body (which may be nil or empty).
// This is provided here as the raw response.Body() reader will have already
// been drained.
Payload []byte `json:"-"`
}
func NewAPIResponse(r *http.Response) *APIResponse {
response := &APIResponse{Response: r}
return response
}
func NewAPIResponseWithError(errorMessage string) *APIResponse {
response := &APIResponse{Message: errorMessage}
return response
}