Upgrade to Pro — share decks privately, control downloads, hide ads and more …

msgraph: Microsoft Graph API Client with Ruby

jinroq
September 05, 2020

msgraph: Microsoft Graph API Client with Ruby

jinroq

September 05, 2020
Tweet

More Decks by jinroq

Other Decks in Programming

Transcript

  1. OpenAPI Generator • Generate API client and Server stub from

    OpenAPI definition • Many language and framework supported (OpenAPI Generator is a folk of Swagger Codegen) 6TJOH0QFO"1*(FOFSBUPS IUUQTTQFBLFSEFDLDPNPUBZIPXUPVTFPQFOBQJGPSBQJEFWFMPQFSSVCZLBJHJ TMJEF
  2. w 0QFO%BUB 0%BUB 1SPUPDPM w $VSSFOUWFSTJPOJT w %BUBGPSNBUT w 0%BUBSFRVFTUTBOESFTQPOTFTJTVTJOHB+40/GPSNBU

    w 4DIFNBEFpOJUJPOBOEEBUBNPEFMJTVTJOH9.-PS+40/GPSNBU w .JDSPTPGU(SBQIQSPWJEFT9.-POMZ w 4UBOEBSEJ[FECZ0"4*4JO w "QQSPWFEBTBO*40*&$JOUFSOBUJPOBMTUBOEBSEJO .JDSPTPGU(SBQI"1*4QFDJpDBUJPOT
  3.  Ɣ GEWIW  ;L]-QEOI%4-GPMIRXW 4YFPMG%4-W 4VMZEXI%4-W 'PMIRXHIZIPSTIVÓÓ%4-HIZIPSTIV  

    'PMIRXHIZIPSTIV‹Ó%4-HIZIPSTIV   6TJOHTVFNFUIPE 5FOUBUJWF/BNF IUUQTTQFBLFSEFDLDPNTVFCFTUQSBDUJDFTJOXFCBQJDMJFOUEFWFMPQNFOUOVNCFSSVCZLBJHJ TMJEF
  4.  Ɣ GEWIW  ;L]-QEOI%4-GPMIRXW 4YFPMG%4-W 4VMZEXI%4-W 'PMIRXHIZIPSTIVÓÓ%4-HIZIPSTIV  

    'PMIRXHIZIPSTIV‹Ó%4-HIZIPSTIV   6TJOHTVFNFUIPE IUUQTTQFBLFSEFDLDPNTVFCFTUQSBDUJDFTJOXFCBQJDMJFOUEFWFMPQNFOUOVNCFSSVCZLBJHJ TMJEF
  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VTFSHFU VTFS@JE $SFBUFVTFS 1045

    NHVTFSDSFBUF 6QEBUFVTFS 1"5$) NHVTFSVQEBUF VTFS@JE %FMFUFVTFS %&-&5& NHVTFSEFMFUF VTFS@JE mg = MicrosoftGraph.new .JDSPTPGU(SBQI"1*4JNQMF*OUFSGBDF &YBNQMF
  10. 3FJOWFOUJOHUIFXIFFM !"" lib #"" microsoft_graph.rb !"" microsoft_graph #"" ... #""

    many many many classes!! #"" ... !"" user.rb .JDSPTPGU(SBQI"1*%JSFDUPSZIJFSBSDIZ &YBNQMF Too many
  11. 3FJOWFOUJOHUIFXIFFM !"" lib #"" microsoft_graph.rb !"" microsoft_graph #"" ... #""

    many many many classes!! #"" ... !"" user.rb .JDSPTPGU(SBQI"1*%JSFDUPSZIJFSBSDIZ &YBNQMF Too many
  12. ✀㢮䛾䝁䞊䝗䝆䜵䝛䝺䞊䝍䛾Ꮡᅾ Ɣ 17+VETL7(/'SHI+IRIVEXSV LXXTWKMXLYFGSQQMGVSWSJXKVETL17+VETL7(/'SHI+IRIVEXSV ż 1MGVSWSJXබᘧ17+VETL7(/䝁䞊䝗䝆䜵䝛䝺䞊䝍 ż '䛚䜘䜃2)8*VEQI[SVO䛻䜘䜛ᐇ⿦ 㛤Ⓨ䛻;MRHS[W䛜ᚲせ ż

    ' 2)8'SVI .EZE.EZE7GVMTX3FNIGXMZI'4]XLSR Ɣ QWKVETLKS䝁䞊䝗䝆䜵䝛䝺䞊䝍 LXXTWKMXLYFGSQ]EIKEWLMQWKVETLKSKIR ż 4YVI+S䛻䜘䜛ᐇ⿦ .4(SBQI4%,$PEF(FOFSBUPS IUUQTXXXTMJEFTIBSFOFUZBFHBTIJNJDSPTPGUHSBQIBQJMJCSBSZGPSHP
  13. w 0QFO%BUB 0%BUB 1SPUPDPM w $VSSFOUWFSTJPOJT w %BUBGPSNBUT w 0%BUBSFRVFTUTBOESFTQPOTFTJTVTJOHB+40/GPSNBU

    w 4DIFNBEFpOJUJPOBOEEBUBNP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