Skip to content

Commit

Permalink
Fix names
Browse files Browse the repository at this point in the history
  • Loading branch information
earthboundkid committed Jul 12, 2024
1 parent 8de9ae3 commit 5f93928
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions builder_core.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ func (rb *Builder) Param(key string, values ...string) *Builder {
return rb
}

// OptionalParam sets a query parameter on a Builder's URL
// only if it is not set by some other call to Param or OptionalParam.
func (rb *Builder) OptionalParam(key string, values ...string) *Builder {
rb.ub.OptionalParam(key, values...)
// ParamOptional sets a query parameter on a Builder's URL
// only if it is not set by some other call to Param or ParamOptional.
func (rb *Builder) ParamOptional(key string, values ...string) *Builder {
rb.ub.ParamOptional(key, values...)
return rb
}

Expand All @@ -130,10 +130,10 @@ func (rb *Builder) Header(key string, values ...string) *Builder {
return rb
}

// OptionalHeader sets a header on a request
// only if it has not already been set by another call to Header or OptionalHeader.
func (rb *Builder) OptionalHeader(key string, values ...string) *Builder {
rb.rb.OptionalHeader(key, values...)
// HeaderOptional sets a header on a request
// only if it has not already been set by another call to Header or HeaderOptional.
func (rb *Builder) HeaderOptional(key string, values ...string) *Builder {
rb.rb.HeaderOptional(key, values...)
return rb
}

Expand Down
2 changes: 1 addition & 1 deletion builder_extras.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (rb *Builder) BodySerializer(s Serializer, v any) *Builder {
func (rb *Builder) BodyJSON(v any) *Builder {
return rb.
Body(BodyJSON(v)).
OptionalHeader("Content-Type", "application/json")
HeaderOptional("Content-Type", "application/json")
}

// BodyForm sets the Builder's request body to the encoded form.
Expand Down
2 changes: 1 addition & 1 deletion core_req.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (rb *requestBuilder) Header(key string, values ...string) {
rb.headers = append(rb.headers, multimap{key, values, false})
}

func (rb *requestBuilder) OptionalHeader(key string, values ...string) {
func (rb *requestBuilder) HeaderOptional(key string, values ...string) {
rb.headers = append(rb.headers, multimap{key, values, true})
}

Expand Down
2 changes: 1 addition & 1 deletion core_url.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (ub *urlBuilder) Param(key string, values ...string) {
ub.params = append(ub.params, multimap{key, values, false})
}

func (ub *urlBuilder) OptionalParam(key string, values ...string) {
func (ub *urlBuilder) ParamOptional(key string, values ...string) {
ub.params = append(ub.params, multimap{key, values, true})
}

Expand Down

0 comments on commit 5f93928

Please sign in to comment.