Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a few missing fields to some API's #86

Merged
merged 1 commit into from
Sep 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions fastly/acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ type ACL struct {

Name string `mapstructure:"name"`
ID string `mapstructure:"id"`

DeletedAt string `mapstructure:"deleted_at"`
CreatedAt string `mapstructure:"created_at"`
UpdatedAt string `mapstructure:"updated_at"`
}

// ACLsByName is a sortable list of ACLs.
Expand Down
4 changes: 4 additions & 0 deletions fastly/acl_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ type ACLEntry struct {
Subnet string `mapstructure:"subnet"`
Negated bool `mapstructure:"negated"`
Comment string `mapstructure:"comment"`

DeletedAt string `mapstructure:"deleted_at"`
CreatedAt string `mapstructure:"created_at"`
UpdatedAt string `mapstructure:"updated_at"`
}

// entriesById is a sortable list of ACL entries.
Expand Down
3 changes: 3 additions & 0 deletions fastly/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type Backend struct {
Version int `mapstructure:"version"`

Name string `mapstructure:"name"`
Comment string `mapstructure:"comment"`
Address string `mapstructure:"address"`
Port uint `mapstructure:"port"`
ConnectTimeout uint `mapstructure:"connect_timeout"`
Expand Down Expand Up @@ -88,6 +89,7 @@ type CreateBackendInput struct {
Version int

Name string `form:"name,omitempty"`
Comment string `form:"comment,omitempty"`
Address string `form:"address,omitempty"`
Port uint `form:"port,omitempty"`
ConnectTimeout uint `form:"connect_timeout,omitempty"`
Expand Down Expand Up @@ -185,6 +187,7 @@ type UpdateBackendInput struct {
Name string

NewName string `form:"name,omitempty"`
Comment string `form:"comment,omitempty"`
Address string `form:"address,omitempty"`
Port uint `form:"port,omitempty"`
ConnectTimeout uint `form:"connect_timeout,omitempty"`
Expand Down
3 changes: 3 additions & 0 deletions fastly/condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type Condition struct {
Version int `mapstructure:"version"`

Name string `mapstructure:"name"`
Comment string `mapstructure:"comment"`
Statement string `mapstructure:"statement"`
Type string `mapstructure:"type"`
Priority int `mapstructure:"priority"`
Expand Down Expand Up @@ -144,6 +145,8 @@ type UpdateConditionInput struct {
// Name is the name of the condition to update.
Name string

NewName string `form:"name,omitempty"`
Comment string `form:"comment,omitempty"`
Statement string `form:"statement,omitempty"`
Type string `form:"type,omitempty"`
Priority int `form:"priority,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions fastly/condition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ func TestClient_Conditions(t *testing.T) {
Service: testServiceID,
Version: tv.Number,
Name: "test/condition",
NewName: "new-test/condition",
Statement: "req.url~+\"updated.html\"",
})
})
Expand Down
6 changes: 4 additions & 2 deletions fastly/dictionary.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ type CreateDictionaryInput struct {
Service string
Version int

Name string `form:"name,omitempty"`
Name string `form:"name,omitempty"`
WriteOnly *Compatibool `form:"write_only,omitempty"`
}

// CreateDictionary creates a new Fastly dictionary.
Expand Down Expand Up @@ -156,7 +157,8 @@ type UpdateDictionaryInput struct {
// Name is the name of the dictionary to update.
Name string

NewName string `form:"name,omitempty"`
NewName string `form:"name,omitempty"`
WriteOnly *Compatibool `form:"write_only,omitempty"`
}

// UpdateDictionary updates a specific dictionary.
Expand Down
28 changes: 19 additions & 9 deletions fastly/director.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@ type Director struct {

Name string `mapstructure:"name"`
Comment string `mapstructure:"comment"`
Shield string `mapstructure:"shield"`
Quorum uint `mapstructure:"quorum"`
Type DirectorType `mapstructure:"type"`
Retries uint `mapstructure:"retries"`
Capacity uint `mapstructure:"capacity"`

DeletedAt string `mapstructure:"deleted_at"`
CreatedAt string `mapstructure:"created_at"`
UpdatedAt string `mapstructure:"updated_at"`
}

// directorsByName is a sortable list of directors.
Expand Down Expand Up @@ -85,11 +90,13 @@ type CreateDirectorInput struct {
Service string
Version int

Name string `form:"name,omitempty"`
Comment string `form:"comment,omitempty"`
Quorum uint `form:"quorum,omitempty"`
Type DirectorType `form:"type,omitempty"`
Retries uint `form:"retries,omitempty"`
Name string `form:"name,omitempty"`
Comment string `form:"comment,omitempty"`
Shield string `form:"shield,omitempty"`
Quorum uint `form:"quorum,omitempty"`
Type DirectorType `form:"type,omitempty"`
Retries uint `form:"retries,omitempty"`
Capacity uint `form:"capacity,omitempty"`
}

// CreateDirector creates a new Fastly director.
Expand Down Expand Up @@ -163,10 +170,13 @@ type UpdateDirectorInput struct {
// Name is the name of the director to update.
Name string

Comment string `form:"comment,omitempty"`
Quorum uint `form:"quorum,omitempty"`
Type DirectorType `form:"type,omitempty"`
Retries uint `form:"retries,omitempty"`
NewName string `form:"name,omitempty"`
Comment string `form:"comment,omitempty"`
Shield string `form:"shield,omitempty"`
Quorum uint `form:"quorum,omitempty"`
Type DirectorType `form:"type,omitempty"`
Retries uint `form:"retries,omitempty"`
Capacity uint `form:"capacity,omitempty"`
}

// UpdateDirector updates a specific director.
Expand Down
1 change: 1 addition & 0 deletions fastly/director_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func TestClient_Directors(t *testing.T) {
Service: testServiceID,
Version: tv.Number,
Name: "test-director",
NewName: "new-test-director",
Quorum: 100,
})
})
Expand Down
1 change: 0 additions & 1 deletion fastly/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ type Domain struct {

Name string `mapstructure:"name"`
Comment string `mapstructure:"comment"`
Locked bool `mapstructure:"locked"`
}

// domainsByName is a sortable list of backends.
Expand Down
3 changes: 3 additions & 0 deletions fastly/health_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type HealthCheck struct {
Version int `mapstructure:"version"`

Name string `mapstructure:"name"`
Comment string `mapstructure:"comment"`
Method string `mapstructure:"method"`
Host string `mapstructure:"host"`
Path string `mapstructure:"path"`
Expand Down Expand Up @@ -75,6 +76,7 @@ type CreateHealthCheckInput struct {
Version int

Name string `form:"name,omitempty"`
Comment string `form:"comment,omitempty"`
Method string `form:"method,omitempty"`
Host string `form:"host,omitempty"`
Path string `form:"path,omitempty"`
Expand Down Expand Up @@ -159,6 +161,7 @@ type UpdateHealthCheckInput struct {
Name string

NewName string `form:"name,omitempty"`
Comment string `form:"comment,omitempty"`
Method string `form:"method,omitempty"`
Host string `form:"host,omitempty"`
Path string `form:"path,omitempty"`
Expand Down