github.com/fumiama/NanoBot@v0.0.0-20231122134259-c22d8183efca/openapi_codegen_getopenapiof.go (about)

     1  // Code generated by codegen/getopenapiof. DO NOT EDIT.
     2  
     3  package nano
     4  
     5  import (
     6  	"github.com/pkg/errors"
     7  )
     8  
     9  func (bot *Bot) getOpenAPIofShardWSSGateway(ep string) (*ShardWSSGateway, error) {
    10  	resp := &struct {
    11  		CodeMessageBase
    12  		ShardWSSGateway
    13  	}{}
    14  	err := bot.GetOpenAPI(ep, "", resp)
    15  	if err != nil {
    16  		err = errors.Wrap(err, getCallerFuncName())
    17  	}
    18  	return &resp.ShardWSSGateway, err
    19  }
    20  
    21  func (bot *Bot) getOpenAPIofUser(ep string) (*User, error) {
    22  	resp := &struct {
    23  		CodeMessageBase
    24  		User
    25  	}{}
    26  	err := bot.GetOpenAPI(ep, "", resp)
    27  	if err != nil {
    28  		err = errors.Wrap(err, getCallerFuncName())
    29  	}
    30  	return &resp.User, err
    31  }
    32  
    33  func (bot *Bot) getOpenAPIofGuild(ep string) (*Guild, error) {
    34  	resp := &struct {
    35  		CodeMessageBase
    36  		Guild
    37  	}{}
    38  	err := bot.GetOpenAPI(ep, "", resp)
    39  	if err != nil {
    40  		err = errors.Wrap(err, getCallerFuncName())
    41  	}
    42  	return &resp.Guild, err
    43  }
    44  
    45  func (bot *Bot) getOpenAPIofChannel(ep string) (*Channel, error) {
    46  	resp := &struct {
    47  		CodeMessageBase
    48  		Channel
    49  	}{}
    50  	err := bot.GetOpenAPI(ep, "", resp)
    51  	if err != nil {
    52  		err = errors.Wrap(err, getCallerFuncName())
    53  	}
    54  	return &resp.Channel, err
    55  }
    56  
    57  func (bot *Bot) getOpenAPIofMember(ep string) (*Member, error) {
    58  	resp := &struct {
    59  		CodeMessageBase
    60  		Member
    61  	}{}
    62  	err := bot.GetOpenAPI(ep, "", resp)
    63  	if err != nil {
    64  		err = errors.Wrap(err, getCallerFuncName())
    65  	}
    66  	return &resp.Member, err
    67  }
    68  
    69  func (bot *Bot) getOpenAPIofRoleMembers(ep string) (*RoleMembers, error) {
    70  	resp := &struct {
    71  		CodeMessageBase
    72  		RoleMembers
    73  	}{}
    74  	err := bot.GetOpenAPI(ep, "", resp)
    75  	if err != nil {
    76  		err = errors.Wrap(err, getCallerFuncName())
    77  	}
    78  	return &resp.RoleMembers, err
    79  }
    80  
    81  func (bot *Bot) getOpenAPIofGuildRoleList(ep string) (*GuildRoleList, error) {
    82  	resp := &struct {
    83  		CodeMessageBase
    84  		GuildRoleList
    85  	}{}
    86  	err := bot.GetOpenAPI(ep, "", resp)
    87  	if err != nil {
    88  		err = errors.Wrap(err, getCallerFuncName())
    89  	}
    90  	return &resp.GuildRoleList, err
    91  }
    92  
    93  func (bot *Bot) getOpenAPIofChannelPermissions(ep string) (*ChannelPermissions, error) {
    94  	resp := &struct {
    95  		CodeMessageBase
    96  		ChannelPermissions
    97  	}{}
    98  	err := bot.GetOpenAPI(ep, "", resp)
    99  	if err != nil {
   100  		err = errors.Wrap(err, getCallerFuncName())
   101  	}
   102  	return &resp.ChannelPermissions, err
   103  }
   104  
   105  func (bot *Bot) getOpenAPIofMessage(ep string) (*Message, error) {
   106  	resp := &struct {
   107  		CodeMessageBase
   108  		Message
   109  	}{}
   110  	err := bot.GetOpenAPI(ep, "", resp)
   111  	if err != nil {
   112  		err = errors.Wrap(err, getCallerFuncName())
   113  	}
   114  	return &resp.Message, err
   115  }
   116  
   117  func (bot *Bot) getOpenAPIofMessageSetting(ep string) (*MessageSetting, error) {
   118  	resp := &struct {
   119  		CodeMessageBase
   120  		MessageSetting
   121  	}{}
   122  	err := bot.GetOpenAPI(ep, "", resp)
   123  	if err != nil {
   124  		err = errors.Wrap(err, getCallerFuncName())
   125  	}
   126  	return &resp.MessageSetting, err
   127  }
   128  
   129  func (bot *Bot) getOpenAPIofPinsMessage(ep string) (*PinsMessage, error) {
   130  	resp := &struct {
   131  		CodeMessageBase
   132  		PinsMessage
   133  	}{}
   134  	err := bot.GetOpenAPI(ep, "", resp)
   135  	if err != nil {
   136  		err = errors.Wrap(err, getCallerFuncName())
   137  	}
   138  	return &resp.PinsMessage, err
   139  }
   140  
   141  func (bot *Bot) getOpenAPIofSchedule(ep string) (*Schedule, error) {
   142  	resp := &struct {
   143  		CodeMessageBase
   144  		Schedule
   145  	}{}
   146  	err := bot.GetOpenAPI(ep, "", resp)
   147  	if err != nil {
   148  		err = errors.Wrap(err, getCallerFuncName())
   149  	}
   150  	return &resp.Schedule, err
   151  }
   152  
   153  func (bot *Bot) getOpenAPIofMessageReactionUsers(ep string) (*MessageReactionUsers, error) {
   154  	resp := &struct {
   155  		CodeMessageBase
   156  		MessageReactionUsers
   157  	}{}
   158  	err := bot.GetOpenAPI(ep, "", resp)
   159  	if err != nil {
   160  		err = errors.Wrap(err, getCallerFuncName())
   161  	}
   162  	return &resp.MessageReactionUsers, err
   163  }