From 5f939283fadfbe2a9651e841922692bf9be58bd8 Mon Sep 17 00:00:00 2001 From: Carlana Johnson Date: Fri, 23 Feb 2024 21:46:03 -0500 Subject: [PATCH] Fix names --- builder_core.go | 16 ++++++++-------- builder_extras.go | 2 +- core_req.go | 2 +- core_url.go | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/builder_core.go b/builder_core.go index 32ec33e..ef50cb4 100644 --- a/builder_core.go +++ b/builder_core.go @@ -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 } @@ -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 } diff --git a/builder_extras.go b/builder_extras.go index 6e8a51c..4fb6d2a 100644 --- a/builder_extras.go +++ b/builder_extras.go @@ -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. diff --git a/core_req.go b/core_req.go index daa3c5b..f1e0f58 100644 --- a/core_req.go +++ b/core_req.go @@ -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}) } diff --git a/core_url.go b/core_url.go index c724273..2dc1a9f 100644 --- a/core_url.go +++ b/core_url.go @@ -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}) }