Skip to content

Commit

Permalink
Add protocol.ReverseDomainNameSet (#32)
Browse files Browse the repository at this point in the history
* Fix protocol.ReverseDomainNameGet

 - Remove "IPv"
 - Fix URI

* Add protocol.ReverseDomainNameSet

* fix
  • Loading branch information
mamiya312 authored Oct 28, 2021
1 parent 40c2bc7 commit 67be561
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 3 deletions.
5 changes: 2 additions & 3 deletions protocol/ReverseDomainNameGet.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ import (
type ReverseDomainNameGet struct {
GisServiceCode string `json:"-"` // P2契約のサービスコード(gis########)
IPv4Address string `json:"-"` // 割り当てられたIPv4アドレス(IPv4アドレス)
IPv string `json:"-"` // IPv
}

// URI /{{.GisServiceCode}}/global-network/{{.IPv}}4Address/name.json
// URI /{{.GisServiceCode}}/global-network/{{.IPv4Address}}/name.json
func (t ReverseDomainNameGet) URI() string {
return "/{{.GisServiceCode}}/global-network/{{.IPv}}4Address/name.json"
return "/{{.GisServiceCode}}/global-network/{{.IPv4Address}}/name.json"
}

// APIName ReverseDomainNameGet
Expand Down
53 changes: 53 additions & 0 deletions protocol/ReverseDomainNameSet.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package protocol

import (
"reflect"
)

// ReverseDomainNameSet 逆引きドメイン名設定 (同期)
// https://manual.iij.jp/p2/pubapi/62130378.html
type ReverseDomainNameSet struct {
GisServiceCode string `json:"-"` // P2契約のサービスコード(gis########)
IPv4Address string `json:"-"` // 割り当てられたIPv4アドレス(IPv4アドレス)
DomainName string // 逆引きドメイン名
}

// URI /{{.GisServiceCode}}/global-network/{{.IPv4Address}}/name.json
func (t ReverseDomainNameSet) URI() string {
return "/{{.GisServiceCode}}/global-network/{{.IPv4Address}}/name.json"
}

// APIName ReverseDomainNameSet
func (t ReverseDomainNameSet) APIName() string {
return "ReverseDomainNameSet"
}

// Method PUT
func (t ReverseDomainNameSet) Method() string {
return "PUT"
}

// Document http://manual.iij.jp/p2/pubapi/59940525.html
func (t ReverseDomainNameSet) Document() string {
return "http://manual.iij.jp/p2/pubapi/59940525.html"
}

// JPName 逆引きドメイン名設定
func (t ReverseDomainNameSet) JPName() string {
return "逆引きドメイン名設定"
}
func init() {
APIlist = append(APIlist, ReverseDomainNameSet{})
TypeMap["ReverseDomainNameSet"] = reflect.TypeOf(ReverseDomainNameSet{})
}

// ReverseDomainNameSetResponse 逆引きドメイン名設定のレスポンス
type ReverseDomainNameSetResponse struct {
*CommonResponse
Current struct {
DomainName string `json:",omitempty"` // 設定した逆引きドメイン名
} `json:",omitempty"`
Previous struct {
DomainName string `json:",omitempty"` // 設定前の逆引きドメイン名
} `json:",omitempty"`
}

0 comments on commit 67be561

Please sign in to comment.