File: primary_ip.go

package info (click to toggle)
golang-github-hetznercloud-hcloud-go 2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,072 kB
  • sloc: sh: 5; makefile: 2
file content (62 lines) | stat: -rw-r--r-- 1,987 bytes parent folder | download
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package schema

import "time"

// PrimaryIP defines a Primary IP.
type PrimaryIP struct {
	ID           int64               `json:"id"`
	IP           string              `json:"ip"`
	Labels       map[string]string   `json:"labels"`
	Name         string              `json:"name"`
	Type         string              `json:"type"`
	Protection   PrimaryIPProtection `json:"protection"`
	DNSPtr       []PrimaryIPDNSPTR   `json:"dns_ptr"`
	AssigneeID   int64               `json:"assignee_id"`
	AssigneeType string              `json:"assignee_type"`
	AutoDelete   bool                `json:"auto_delete"`
	Blocked      bool                `json:"blocked"`
	Created      time.Time           `json:"created"`
	Datacenter   Datacenter          `json:"datacenter"`
}

// PrimaryIPProtection represents the protection level of a Primary IP.
type PrimaryIPProtection struct {
	Delete bool `json:"delete"`
}

// PrimaryIPDNSPTR contains reverse DNS information for a
// IPv4 or IPv6 Primary IP.
type PrimaryIPDNSPTR struct {
	DNSPtr string `json:"dns_ptr"`
	IP     string `json:"ip"`
}

// PrimaryIPCreateResponse defines the schema of the response
// when creating a Primary IP.
type PrimaryIPCreateResponse struct {
	PrimaryIP PrimaryIP `json:"primary_ip"`
	Action    *Action   `json:"action"`
}

// PrimaryIPGetResult defines the response when retrieving a single Primary IP.
type PrimaryIPGetResult struct {
	PrimaryIP PrimaryIP `json:"primary_ip"`
}

// PrimaryIPListResult defines the response when listing Primary IPs.
type PrimaryIPListResult struct {
	PrimaryIPs []PrimaryIP `json:"primary_ips"`
}

// PrimaryIPUpdateResult defines the response
// when updating a Primary IP.
type PrimaryIPUpdateResult struct {
	PrimaryIP PrimaryIP `json:"primary_ip"`
}

// PrimaryIPActionChangeDNSPtrRequest defines the schema for the request to
// change a Primary IP's reverse DNS pointer.
type PrimaryIPActionChangeDNSPtrRequest struct {
	IP     string  `json:"ip"`
	DNSPtr *string `json:"dns_ptr"`
}