func (r *AddOrUpdateMembershipForUserLegacyResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
HTTPResponse returns the *http.Response
package teams
import (
	"context"
	"fmt"
	components "github.com/willabides/octo-go/components"
	requests "github.com/willabides/octo-go/requests"
	"net/http"
	"net/url"
	"strconv"
)
func AddMemberLegacy(ctx context.Context, req *AddMemberLegacyReq, opt ...requests.Option) (*AddMemberLegacyResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(AddMemberLegacyReq)
	}
	resp := &AddMemberLegacyResponse{}
	httpReq, err := req.HTTPRequest(ctx, opt...)
	if err != nil {
		return nil, err
	}
	r, err := opts.HttpClient().Do(httpReq)
	if err != nil {
		return nil, err
	}
	err = resp.ReadResponse(r)
	if err != nil {
		return nil, err
	}
	return resp, nil
}
func (c Client) AddMemberLegacy(ctx context.Context, req *AddMemberLegacyReq, opt ...requests.Option) (*AddMemberLegacyResponse, error) {
	return AddMemberLegacy(ctx, req, append(c, opt...)...)
}
type AddMemberLegacyReq struct {
	_url     string
	TeamId   int64
	Username string
}
func (r *AddMemberLegacyReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		ExplicitURL: r._url,
		Method:      "PUT",
		Options:     opt,
		URLPath:     fmt.Sprintf("/teams/%v/members/%v", r.TeamId, r.Username),
	})
}
func (r *AddMemberLegacyReq) Rel(link string, resp *AddMemberLegacyResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type AddMemberLegacyResponse struct {
	httpResponse *http.Response
}
func (r *AddMemberLegacyResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *AddMemberLegacyResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{204})
	if err != nil {
		return err
	}
	return nil
}
func AddOrUpdateMembershipForUserInOrg(ctx context.Context, req *AddOrUpdateMembershipForUserInOrgReq, opt ...requests.Option) (*AddOrUpdateMembershipForUserInOrgResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(AddOrUpdateMembershipForUserInOrgReq)
	}
	resp := &AddOrUpdateMembershipForUserInOrgResponse{}
	httpReq, err := req.HTTPRequest(ctx, opt...)
	if err != nil {
		return nil, err
	}
	r, err := opts.HttpClient().Do(httpReq)
	if err != nil {
		return nil, err
	}
	err = resp.ReadResponse(r)
	if err != nil {
		return nil, err
	}
	return resp, nil
}
func (c Client) AddOrUpdateMembershipForUserInOrg(ctx context.Context, req *AddOrUpdateMembershipForUserInOrgReq, opt ...requests.Option) (*AddOrUpdateMembershipForUserInOrgResponse, error) {
	return AddOrUpdateMembershipForUserInOrg(ctx, req, append(c, opt...)...)
}
type AddOrUpdateMembershipForUserInOrgReq struct {
	_url string
	Org  string
	TeamSlug    string
	Username    string
	RequestBody AddOrUpdateMembershipForUserInOrgReqBody
}
func (r *AddOrUpdateMembershipForUserInOrgReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		Body:        r.RequestBody,
		ExplicitURL: r._url,
		HeaderVals: map[string]*string{
			"accept":       strPtr("application/json"),
			"content-type": strPtr("application/json"),
		},
		Method:  "PUT",
		Options: opt,
		URLPath: fmt.Sprintf("/orgs/%v/teams/%v/memberships/%v", r.Org, r.TeamSlug, r.Username),
	})
}
func (r *AddOrUpdateMembershipForUserInOrgReq) Rel(link string, resp *AddOrUpdateMembershipForUserInOrgResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type AddOrUpdateMembershipForUserInOrgReqBody struct {
	Role *string `json:"role,omitempty"`
}
type AddOrUpdateMembershipForUserInOrgResponse struct {
	httpResponse *http.Response
	Data         components.TeamMembership
}
func (r *AddOrUpdateMembershipForUserInOrgResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *AddOrUpdateMembershipForUserInOrgResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{200})
	if err != nil {
		return err
	}
	if intInSlice(resp.StatusCode, []int{200}) {
		err = unmarshalResponseBody(resp, &r.Data)
		if err != nil {
			return err
		}
	}
	return nil
}
func AddOrUpdateMembershipForUserLegacy(ctx context.Context, req *AddOrUpdateMembershipForUserLegacyReq, opt ...requests.Option) (*AddOrUpdateMembershipForUserLegacyResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(AddOrUpdateMembershipForUserLegacyReq)
	}
	resp := &AddOrUpdateMembershipForUserLegacyResponse{}
	httpReq, err := req.HTTPRequest(ctx, opt...)
	if err != nil {
		return nil, err
	}
	r, err := opts.HttpClient().Do(httpReq)
	if err != nil {
		return nil, err
	}
	err = resp.ReadResponse(r)
	if err != nil {
		return nil, err
	}
	return resp, nil
}
func (c Client) AddOrUpdateMembershipForUserLegacy(ctx context.Context, req *AddOrUpdateMembershipForUserLegacyReq, opt ...requests.Option) (*AddOrUpdateMembershipForUserLegacyResponse, error) {
	return AddOrUpdateMembershipForUserLegacy(ctx, req, append(c, opt...)...)
}
type AddOrUpdateMembershipForUserLegacyReq struct {
	_url        string
	TeamId      int64
	Username    string
	RequestBody AddOrUpdateMembershipForUserLegacyReqBody
}
func (r *AddOrUpdateMembershipForUserLegacyReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		Body:        r.RequestBody,
		ExplicitURL: r._url,
		HeaderVals: map[string]*string{
			"accept":       strPtr("application/json"),
			"content-type": strPtr("application/json"),
		},
		Method:  "PUT",
		Options: opt,
		URLPath: fmt.Sprintf("/teams/%v/memberships/%v", r.TeamId, r.Username),
	})
}
func (r *AddOrUpdateMembershipForUserLegacyReq) Rel(link string, resp *AddOrUpdateMembershipForUserLegacyResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type AddOrUpdateMembershipForUserLegacyReqBody struct {
	Role *string `json:"role,omitempty"`
}
type AddOrUpdateMembershipForUserLegacyResponse struct {
	httpResponse *http.Response
	Data         components.TeamMembership
}