func (r *CreatePublicSshKeyForAuthenticatedReq) Rel(link string, resp *CreatePublicSshKeyForAuthenticatedResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
/*
Rel updates this request to point to a relative link from resp. Returns false if
the link does not exist. Handy for paging.
package users
import (
	"context"
	"encoding/json"
	"fmt"
	components "github.com/willabides/octo-go/components"
	requests "github.com/willabides/octo-go/requests"
	"net/http"
	"net/url"
	"strconv"
)
func AddEmailForAuthenticated(ctx context.Context, req *AddEmailForAuthenticatedReq, opt ...requests.Option) (*AddEmailForAuthenticatedResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(AddEmailForAuthenticatedReq)
	}
	resp := &AddEmailForAuthenticatedResponse{}
	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) AddEmailForAuthenticated(ctx context.Context, req *AddEmailForAuthenticatedReq, opt ...requests.Option) (*AddEmailForAuthenticatedResponse, error) {
	return AddEmailForAuthenticated(ctx, req, append(c, opt...)...)
}
type AddEmailForAuthenticatedReq struct {
	_url        string
	RequestBody AddEmailForAuthenticatedReqBody
}
func (r *AddEmailForAuthenticatedReq) 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:  "POST",
		Options: opt,
		URLPath: fmt.Sprintf("/user/emails"),
	})
}
func (r *AddEmailForAuthenticatedReq) Rel(link string, resp *AddEmailForAuthenticatedResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type AddEmailForAuthenticatedReqBody struct {
	Emails []string `json:"emails"`
}
type AddEmailForAuthenticatedResponse struct {
	httpResponse *http.Response
	Data         []components.Email
}
func (r *AddEmailForAuthenticatedResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *AddEmailForAuthenticatedResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{201, 304})
	if err != nil {
		return err
	}
	if intInSlice(resp.StatusCode, []int{201}) {
		err = unmarshalResponseBody(resp, &r.Data)
		if err != nil {
			return err
		}
	}
	return nil
}
func Block(ctx context.Context, req *BlockReq, opt ...requests.Option) (*BlockResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(BlockReq)
	}
	resp := &BlockResponse{}
	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) Block(ctx context.Context, req *BlockReq, opt ...requests.Option) (*BlockResponse, error) {
	return Block(ctx, req, append(c, opt...)...)
}
type BlockReq struct {
	_url     string
	Username string
}
func (r *BlockReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		ExplicitURL: r._url,
		Method:      "PUT",
		Options:     opt,
		URLPath:     fmt.Sprintf("/user/blocks/%v", r.Username),
	})
}
func (r *BlockReq) Rel(link string, resp *BlockResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type BlockResponse struct {
	httpResponse *http.Response
}
func (r *BlockResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *BlockResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{204, 304})
	if err != nil {
		return err
	}
	return nil
}
func CheckBlocked(ctx context.Context, req *CheckBlockedReq, opt ...requests.Option) (*CheckBlockedResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CheckBlockedReq)
	}
	resp := &CheckBlockedResponse{}
	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) CheckBlocked(ctx context.Context, req *CheckBlockedReq, opt ...requests.Option) (*CheckBlockedResponse, error) {
	return CheckBlocked(ctx, req, append(c, opt...)...)
}
type CheckBlockedReq struct {
	_url     string
	Username string
}
func (r *CheckBlockedReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		ExplicitURL: r._url,
		Method:      "GET",
		Options:     opt,
		URLPath:     fmt.Sprintf("/user/blocks/%v", r.Username),
	})
}
func (r *CheckBlockedReq) Rel(link string, resp *CheckBlockedResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CheckBlockedResponse struct {
	httpResponse *http.Response
}
func (r *CheckBlockedResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CheckBlockedResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{204, 304})
	if err != nil {
		return err
	}
	return nil
}
func CheckFollowingForUser(ctx context.Context, req *CheckFollowingForUserReq, opt ...requests.Option) (*CheckFollowingForUserResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CheckFollowingForUserReq)
	}
	resp := &CheckFollowingForUserResponse{}
	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) CheckFollowingForUser(ctx context.Context, req *CheckFollowingForUserReq, opt ...requests.Option) (*CheckFollowingForUserResponse, error) {
	return CheckFollowingForUser(ctx, req, append(c, opt...)...)
}
type CheckFollowingForUserReq struct {
	_url     string
	Username string
	TargetUser string
}
func (r *CheckFollowingForUserReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		ExplicitURL: r._url,
		Method:      "GET",
		Options:     opt,
		URLPath:     fmt.Sprintf("/users/%v/following/%v", r.Username, r.TargetUser),
	})
}
func (r *CheckFollowingForUserReq) Rel(link string, resp *CheckFollowingForUserResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CheckFollowingForUserResponse struct {
	httpResponse *http.Response
	Data         bool
}
func (r *CheckFollowingForUserResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CheckFollowingForUserResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{204, 404})
	if err != nil {
		return err
	}
	err = setBoolResult(resp, &r.Data)
	if err != nil {
		return err
	}
	return nil
}
func CheckPersonIsFollowedByAuthenticated(ctx context.Context, req *CheckPersonIsFollowedByAuthenticatedReq, opt ...requests.Option) (*CheckPersonIsFollowedByAuthenticatedResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CheckPersonIsFollowedByAuthenticatedReq)
	}
	resp := &CheckPersonIsFollowedByAuthenticatedResponse{}
	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) CheckPersonIsFollowedByAuthenticated(ctx context.Context, req *CheckPersonIsFollowedByAuthenticatedReq, opt ...requests.Option) (*CheckPersonIsFollowedByAuthenticatedResponse, error) {
	return CheckPersonIsFollowedByAuthenticated(ctx, req, append(c, opt...)...)
}
type CheckPersonIsFollowedByAuthenticatedReq struct {
	_url     string
	Username string
}
func (r *CheckPersonIsFollowedByAuthenticatedReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		ExplicitURL: r._url,
		Method:      "GET",
		Options:     opt,
		URLPath:     fmt.Sprintf("/user/following/%v", r.Username),
	})
}
func (r *CheckPersonIsFollowedByAuthenticatedReq) Rel(link string, resp *CheckPersonIsFollowedByAuthenticatedResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CheckPersonIsFollowedByAuthenticatedResponse struct {
	httpResponse *http.Response
}
func (r *CheckPersonIsFollowedByAuthenticatedResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CheckPersonIsFollowedByAuthenticatedResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{204, 304})
	if err != nil {
		return err
	}
	return nil
}
func CreateGpgKeyForAuthenticated(ctx context.Context, req *CreateGpgKeyForAuthenticatedReq, opt ...requests.Option) (*CreateGpgKeyForAuthenticatedResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CreateGpgKeyForAuthenticatedReq)
	}
	resp := &CreateGpgKeyForAuthenticatedResponse{}
	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) CreateGpgKeyForAuthenticated(ctx context.Context, req *CreateGpgKeyForAuthenticatedReq, opt ...requests.Option) (*CreateGpgKeyForAuthenticatedResponse, error) {
	return CreateGpgKeyForAuthenticated(ctx, req, append(c, opt...)...)
}
type CreateGpgKeyForAuthenticatedReq struct {
	_url        string
	RequestBody CreateGpgKeyForAuthenticatedReqBody
}
func (r *CreateGpgKeyForAuthenticatedReq) 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:  "POST",
		Options: opt,
		URLPath: fmt.Sprintf("/user/gpg_keys"),
	})
}
func (r *CreateGpgKeyForAuthenticatedReq) Rel(link string, resp *CreateGpgKeyForAuthenticatedResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CreateGpgKeyForAuthenticatedReqBody struct {
	ArmoredPublicKey *string `json:"armored_public_key"`
}
type CreateGpgKeyForAuthenticatedResponse struct {
	httpResponse *http.Response
	Data         components.GpgKey
}
func (r *CreateGpgKeyForAuthenticatedResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CreateGpgKeyForAuthenticatedResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{201, 304})
	if err != nil {
		return err
	}
	if intInSlice(resp.StatusCode, []int{201}) {
		err = unmarshalResponseBody(resp, &r.Data)
		if err != nil {
			return err
		}
	}
	return nil
}
func CreatePublicSshKeyForAuthenticated(ctx context.Context, req *CreatePublicSshKeyForAuthenticatedReq, opt ...requests.Option) (*CreatePublicSshKeyForAuthenticatedResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CreatePublicSshKeyForAuthenticatedReq)
	}
	resp := &CreatePublicSshKeyForAuthenticatedResponse{}
	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) CreatePublicSshKeyForAuthenticated(ctx context.Context, req *CreatePublicSshKeyForAuthenticatedReq, opt ...requests.Option) (*CreatePublicSshKeyForAuthenticatedResponse, error) {
	return CreatePublicSshKeyForAuthenticated(ctx, req, append(c, opt...)...)
}
type CreatePublicSshKeyForAuthenticatedReq struct {
	_url        string
	RequestBody CreatePublicSshKeyForAuthenticatedReqBody
}
func (r *CreatePublicSshKeyForAuthenticatedReq) 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:  "POST",
		Options: opt,
		URLPath: fmt.Sprintf("/user/keys"),
	})
}