Skip to content

Instantly share code, notes, and snippets.

@kkeisuke
Last active November 21, 2019 07:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkeisuke/6e460f97ed864c4563dae1c0e52f13d0 to your computer and use it in GitHub Desktop.
Save kkeisuke/6e460f97ed864c4563dae1c0e52f13d0 to your computer and use it in GitHub Desktop.
line-to-google-photos
@startuml
autonumber
skinparam monochrome true
actor user
participant LINEbot as line
participant "Google\nCloud\nFunctions" as GCP
participant "Google APIs" as googleapis
participant "Google\nPhotos APIs" as photo
user -> line: image upload
line -> GCP: webhook
GCP -> line: request image
line -> GCP: response image
GCP -> googleapis: request Access Token
googleapis -> GCP: response Access Token
GCP -> photo: upload image\ncreate media item
photo -> GCP: response
GCP -> line: request reply
line -> user: reply
@enduml
Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="500px" preserveAspectRatio="none" style="width:645px;height:500px;" version="1.1" viewBox="0 0 645 500" width="645px" zoomAndPan="magnify"><defs><filter height="300%" id="fhkjys7s8xb16" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><line style="stroke: #383838; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="26" x2="26" y1="86.2969" y2="412.7578"/><line style="stroke: #383838; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="150.5" x2="150.5" y1="86.2969" y2="412.7578"/><line style="stroke: #383838; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="290.5" x2="290.5" y1="86.2969" y2="412.7578"/><line style="stroke: #383838; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="477" x2="477" y1="86.2969" y2="412.7578"/><line style="stroke: #383838; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="588" x2="588" y1="86.2969" y2="412.7578"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="31" x="8" y="82.9951">user</text><ellipse cx="26.5" cy="13" fill="#F8F8F8" filter="url(#fhkjys7s8xb16)" rx="8" ry="8" style="stroke: #383838; stroke-width: 2.0;"/><path d="M26.5,21 L26.5,48 M13.5,29 L39.5,29 M26.5,48 L13.5,63 M26.5,48 L39.5,63 " fill="none" filter="url(#fhkjys7s8xb16)" style="stroke: #383838; stroke-width: 2.0;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="31" x="8" y="424.7529">user</text><ellipse cx="26.5" cy="438.0547" fill="#F8F8F8" filter="url(#fhkjys7s8xb16)" rx="8" ry="8" style="stroke: #383838; stroke-width: 2.0;"/><path d="M26.5,446.0547 L26.5,473.0547 M13.5,454.0547 L39.5,454.0547 M26.5,473.0547 L13.5,488.0547 M26.5,473.0547 L39.5,488.0547 " fill="none" filter="url(#fhkjys7s8xb16)" style="stroke: #383838; stroke-width: 2.0;"/><rect fill="#F8F8F8" filter="url(#fhkjys7s8xb16)" height="30.2969" style="stroke: #383838; stroke-width: 1.5;" width="66" x="115.5" y="51"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="52" x="122.5" y="70.9951">LINEbot</text><rect fill="#F8F8F8" filter="url(#fhkjys7s8xb16)" height="30.2969" style="stroke: #383838; stroke-width: 1.5;" width="66" x="115.5" y="411.7578"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="52" x="122.5" y="431.7529">LINEbot</text><rect fill="#F8F8F8" filter="url(#fhkjys7s8xb16)" height="62.8906" style="stroke: #383838; stroke-width: 1.5;" width="82" x="247.5" y="18.4063"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="50" x="263.5" y="38.4014">Google</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="40" x="268.5" y="54.6982">Cloud</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="68" x="254.5" y="70.9951">Functions</text><rect fill="#F8F8F8" filter="url(#fhkjys7s8xb16)" height="62.8906" style="stroke: #383838; stroke-width: 1.5;" width="82" x="247.5" y="411.7578"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="50" x="263.5" y="431.7529">Google</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="40" x="268.5" y="448.0498">Cloud</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="68" x="254.5" y="464.3467">Functions</text><rect fill="#F8F8F8" filter="url(#fhkjys7s8xb16)" height="30.2969" style="stroke: #383838; stroke-width: 1.5;" width="97" x="427" y="51"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="83" x="434" y="70.9951">Google APIs</text><rect fill="#F8F8F8" filter="url(#fhkjys7s8xb16)" height="30.2969" style="stroke: #383838; stroke-width: 1.5;" width="97" x="427" y="411.7578"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="83" x="434" y="431.7529">Google APIs</text><rect fill="#F8F8F8" filter="url(#fhkjys7s8xb16)" height="46.5938" style="stroke: #383838; stroke-width: 1.5;" width="96" x="538" y="34.7031"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="50" x="561" y="54.6982">Google</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="82" x="545" y="70.9951">Photos APIs</text><rect fill="#F8F8F8" filter="url(#fhkjys7s8xb16)" height="46.5938" style="stroke: #383838; stroke-width: 1.5;" width="96" x="538" y="411.7578"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="50" x="561" y="431.7529">Google</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="82" x="545" y="448.0498">Photos APIs</text><polygon fill="#383838" points="138.5,113.4297,148.5,117.4297,138.5,121.4297,142.5,117.4297" style="stroke: #383838; stroke-width: 1.0;"/><line style="stroke: #383838; stroke-width: 1.0;" x1="26.5" x2="144.5" y1="117.4297" y2="117.4297"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="9" x="33.5" y="112.3638">1</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="87" x="46.5" y="112.3638">image upload</text><polygon fill="#383838" points="278.5,142.5625,288.5,146.5625,278.5,150.5625,282.5,146.5625" style="stroke: #383838; stroke-width: 1.0;"/><line style="stroke: #383838; stroke-width: 1.0;" x1="150.5" x2="284.5" y1="146.5625" y2="146.5625"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="9" x="157.5" y="141.4966">2</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="56" x="170.5" y="141.4966">webhook</text><polygon fill="#383838" points="161.5,171.6953,151.5,175.6953,161.5,179.6953,157.5,175.6953" style="stroke: #383838; stroke-width: 1.0;"/><line style="stroke: #383838; stroke-width: 1.0;" x1="155.5" x2="289.5" y1="175.6953" y2="175.6953"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="9" x="167.5" y="170.6294">3</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="93" x="180.5" y="170.6294">request image</text><polygon fill="#383838" points="278.5,200.8281,288.5,204.8281,278.5,208.8281,282.5,204.8281" style="stroke: #383838; stroke-width: 1.0;"/><line style="stroke: #383838; stroke-width: 1.0;" x1="150.5" x2="284.5" y1="204.8281" y2="204.8281"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="9" x="157.5" y="199.7622">4</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="103" x="170.5" y="199.7622">response image</text><polygon fill="#383838" points="465.5,229.9609,475.5,233.9609,465.5,237.9609,469.5,233.9609" style="stroke: #383838; stroke-width: 1.0;"/><line style="stroke: #383838; stroke-width: 1.0;" x1="290.5" x2="471.5" y1="233.9609" y2="233.9609"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="9" x="297.5" y="228.895">5</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="140" x="310.5" y="228.895">request Access Token</text><polygon fill="#383838" points="301.5,259.0938,291.5,263.0938,301.5,267.0938,297.5,263.0938" style="stroke: #383838; stroke-width: 1.0;"/><line style="stroke: #383838; stroke-width: 1.0;" x1="295.5" x2="476.5" y1="263.0938" y2="263.0938"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="9" x="307.5" y="258.0278">6</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="150" x="320.5" y="258.0278">response Access Token</text><polygon fill="#383838" points="576,303.3594,586,307.3594,576,311.3594,580,307.3594" style="stroke: #383838; stroke-width: 1.0;"/><line style="stroke: #383838; stroke-width: 1.0;" x1="290.5" x2="582" y1="307.3594" y2="307.3594"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="9" x="297.5" y="294.7271">7</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="87" x="310.5" y="287.1606">upload image</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="118" x="310.5" y="302.2935">create media item</text><polygon fill="#383838" points="301.5,332.4922,291.5,336.4922,301.5,340.4922,297.5,336.4922" style="stroke: #383838; stroke-width: 1.0;"/><line style="stroke: #383838; stroke-width: 1.0;" x1="295.5" x2="587" y1="336.4922" y2="336.4922"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="9" x="307.5" y="331.4263">8</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="59" x="320.5" y="331.4263">response</text><polygon fill="#383838" points="161.5,361.625,151.5,365.625,161.5,369.625,157.5,365.625" style="stroke: #383838; stroke-width: 1.0;"/><line style="stroke: #383838; stroke-width: 1.0;" x1="155.5" x2="289.5" y1="365.625" y2="365.625"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="9" x="167.5" y="360.5591">9</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="84" x="180.5" y="360.5591">request reply</text><polygon fill="#383838" points="37.5,390.7578,27.5,394.7578,37.5,398.7578,33.5,394.7578" style="stroke: #383838; stroke-width: 1.0;"/><line style="stroke: #383838; stroke-width: 1.0;" x1="31.5" x2="149.5" y1="394.7578" y2="394.7578"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="18" x="43.5" y="389.6919">10</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="31" x="65.5" y="389.6919">reply</text><!--MD5=[fe4c8f86ae639bc14bb59fc78f7aa506]
@startuml
autonumber
skinparam monochrome true
actor user
participant LINEbot as line
participant "Google\nCloud\nFunctions" as GCP
participant "Google APIs" as googleapis
participant "Google\nPhotos APIs" as photo
user -> line: image upload
line -> GCP: webhook
GCP -> line: request image
line -> GCP: response image
GCP -> googleapis: request Access Token
googleapis -> GCP: response Access Token
GCP -> photo: upload image\ncreate media item
photo -> GCP: response
GCP -> line: request reply
line -> user: reply
@enduml
PlantUML version 1.2019.11(Sun Sep 22 10:02:15 UTC 2019)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Java Version: 1.8.0_222-heroku-b10
Operating System: Linux
Default Encoding: UTF-8
Language: en
Country: US
--></g></svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment