Skip to content

Includes Javiers changes #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6d65a2e
Added folder for common files usable for all parts of GSuite
andersoxie Sep 13, 2020
46a103d
Added folder for calendar
andersoxie Sep 13, 2020
f8f9435
First version of Calendar API with some adjustments to sheet implemen…
andersoxie Sep 20, 2020
4ea51f7
Would appriociate with help to create the payload code for payload_cr…
andersoxie Sep 20, 2020
6b06709
Added calendar_event_payload class to show how my intentiion with the…
andersoxie Sep 20, 2020
052486d
Extracted common code to gsuite_base library.
jvelilla Sep 25, 2020
be68e13
Merge pull request #1 from jvelilla/eg_anders
andersoxie Sep 26, 2020
5b560e0
Added payload creation
andersoxie Dec 8, 2020
5c6c7d9
Now possible to create an event
andersoxie Dec 9, 2020
56f555d
Unit test cases adapted to the Event json
andersoxie Dec 10, 2020
5b074a4
Added PUT to api call and implemented update of existing calendar eve…
andersoxie Dec 13, 2020
ab4b3a9
Updated with Calednar id to be able to update an id.
andersoxie Dec 27, 2020
6cf6d0b
Implemented checks of calendar id but not all. Corrected test case
andersoxie Dec 27, 2020
2eb2c9c
Refactoring to be able to add GUI support for applicaiton flow
andersoxie Mar 12, 2021
3180823
Refresh token was not saved when refresing the token
andersoxie Mar 16, 2021
4bacb24
Adding a reminder
andersoxie Mar 20, 2021
b43bd1a
Added status of if it was possible to retrieve a token
andersoxie Sep 24, 2021
6ed16cb
Changes due to update to Eiffel verison 25.02
andersoxie Mar 10, 2025
ac7315f
Merge branch 'preliminary' of github.com:andersoxie/EGSuite into prel…
andersoxie Mar 10, 2025
855ac1d
Removed C in path
andersoxie Mar 11, 2025
4cdd371
Removed json extra d
andersoxie Mar 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added calendar/Readme.md
Empty file.
49 changes: 49 additions & 0 deletions calendar/escalendar.ecf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-23-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-23-0 http://www.eiffel.com/developers/xml/configuration-1-23-0.xsd" name="escalenadar_api" uuid="7CAA645C-314C-45A2-B718-40F4B76AB41F" library_target="escalenadar_api">
<target name="escalenadar_api">
<root all_classes="true"/>
<file_rule>
<exclude>/CVS$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/\.git$</exclude>
<exclude>/\.svn$</exclude>
</file_rule>
<option warning="none" is_obsolete_iteration="true" manifest_array_type="mismatch_warning">
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
</option>
<setting name="console_application" value="true"/>
<setting name="total_order_on_reals" value="false"/>
<capability>
<concurrency support="scoop"/>
<void_safety support="transitional"/>
</capability>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf">
<option warning="none"/>
</library>
<library name="eg_base" location="..\gsuite_base\eg_base.ecf" readonly="false">
<option warning="none"/>
</library>
<library name="encoder" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\text\encoder\encoder.ecf">
<option warning="none"/>
</library>
<library name="http" location="$ISE_LIBRARY\contrib\library\network\protocol\http\http.ecf">
<option warning="none"/>
</library>
<library name="json" location="$ISE_LIBRARY\contrib\library\text\parser\json\library\json.ecf" readonly="false">
<option warning="none"/>
</library>
<library name="json_ext" location="..\..\json_ext_original\json_ext\json_ext.ecf" readonly="false">
<option warning="none"/>
<renaming old_name="JSON_SERIALIZABLE" new_name="JSON_SERIALIZABLE_EXT"/>
</library>
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf">
<option warning="none"/>
</library>
<library name="uri" location="$ISE_LIBRARY\library\text\uri\uri.ecf">
<option warning="none"/>
</library>
<cluster name="escalenadar_api" location=".\src\" recursive="true">
<option warning="none" is_obsolete_iteration="true"/>
</cluster>
</target>
</system>
35 changes: 35 additions & 0 deletions calendar/src/calendar_date.e
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
note
description: "Summary description for {CALENDAR_DATE}."
author: ""
date: "$Date$"
revision: "$Revision$"

class
CALENDAR_DATE

create
make

feature

make(d:DATE; dt: DATE_TIME; tz: STRING)
local
tools :DATE_TIME_TOOLS
do
a_date := d





a_date_time := dt
a_time_zone := tz

end

a_date:DATE
a_date_time : DATE_TIME
a_time_zone : STRING


end
102 changes: 102 additions & 0 deletions calendar/src/calendar_date_payload.e
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
note
description: "Summary description for {CALENDAR_START_PAYLOAD}."
author: ""
date: "$Date$"
revision: "$Revision$"

class
CALENDAR_DATE_PAYLOAD

inherit
JSON_EXT_SERIALIZABLE
undefine
default_create
redefine
json_out,
eiffel_date_to_json_string,
eiffel_date_time_to_json_string
end

create
make_with_date,
default_create


feature

make_with_date(d: CALENDAR_DATE)
do
date := d.a_date
datetime := d.a_date_time
timezone := d.a_time_zone
end


default_create
do
create date.make_now
create datetime.make_now
create timezone.make_empty
end

date: DATE
-- What is the `date' of the Event?
attribute
create Result.make_now
end

datetime: DATE_TIME
-- What is the `datetime' of the Event?
attribute
create Result.make_now
end

timeZone: STRING
-- What `timezone' is the Event in?
attribute
create Result.make_empty
end
feature -- Implementation

eiffel_date_to_json_string (a_key: STRING; a_date: DATE): JSON_STRING
-- Convert `a_date' to JSON_STRING with `a_key'
do
create Result.make_from_string_32 (a_date.formatted_out ("YYYY-[0]MM-[0]DD"))
end


eiffel_date_time_to_json_string (a_key: STRING; a_date_time: DATE_TIME): JSON_STRING
-- Convert `a_date_time' to JSON_STRING with `a_key'
do
create Result.make_from_string_32 (a_date_time.formatted_out ("YYYY-[0]MM-[0]DD") + "T" + a_date_time.formatted_out ("[0]hh:[0]mi")+ ":00")
end



json_out: STRING
--<Precursor>
-- Convert `end_event' to "end", `datetime' to "dateTime", `timezone' to "timeZone" per Google.
do
Result := Precursor
Result.replace_substring_all ("ending", "end")
Result.replace_substring_all ("datetime", "dateTime")
Result.replace_substring_all ("timezone", "timeZone")
end

metadata_refreshed (a_current: ANY): ARRAY [JSON_METADATA]
do
Result := <<
create {JSON_METADATA}.make_text_default
>>
end

convertible_features (a_object: ANY): ARRAY [STRING]
-- <Precursor>
once
Result := <<"datetime","timezone">>
-- Result := <<"date","dateTime","timeZone">>
end



end
42 changes: 42 additions & 0 deletions calendar/src/calendar_event.e
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
note
description: "Summary description for {CALENDAR_EVENT}."
author: ""
date: "$Date$"
revision: "$Revision$"

class
CALENDAR_EVENT

create
make_generate_id,
make

feature


make(start_date, end_date : CALENDAR_DATE; sum, event_id : STRING)
do
sd := start_date
ed := end_date
id := event_id
summary := sum
end


make_generate_id(start_date, end_date : CALENDAR_DATE)
do
sd := start_date
ed := end_date
id := "create unique id"
summary := "summary"
end

sd:CALENDAR_DATE
ed:CALENDAR_DATE
id : STRING
summary : STRING




end
92 changes: 92 additions & 0 deletions calendar/src/calendar_event_payload.e
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
note
description: "Summary description for {CALENDAR_EVENT_PAYLOD}."
author: ""
date: "$Date$"
revision: "$Revision$"

class
CALENDAR_EVENT_PAYLOAD

inherit
JSON_EXT_SERIALIZABLE
undefine
default_create
redefine
json_out
end

create
make,
default_create


feature

make (ce: CALENDAR_EVENT )
do
kind:= "calendar#event"
summary := ce.summary
create start.make_with_date (ce.sd)
create ending.make_with_date (ce.ed)
id := ce.id
end

default_create
do
id := ""
kind:= ""
summary:=""
create start
create ending
end

id : STRING
kind: STRING
summary: STRING
start: CALENDAR_DATE_PAYLOAD
ending: CALENDAR_DATE_PAYLOAD



feature {NONE} -- Implementation: Representation Constants

-- current_representation: STRING
-- do
-- Result := "{" +
-- "%"start%":%"" + start + "%"," +
-- "%"end%":%"" + ending + "%"" +
-- "}"

-- end

feature -- Implementation: Mock Features




feature -- Implementation
json_out: STRING
--<Precursor>
-- Convert `end_event' to "end", `datetime' to "dateTime", `timezone' to "timeZone" per Google.
do
Result := Precursor
Result.replace_substring_all ("ending", "end")
Result.replace_substring_all ("datetime", "dateTime")
Result.replace_substring_all ("timezone", "timeZone")
end


metadata_refreshed (a_current: ANY): ARRAY [JSON_METADATA]
do
Result := <<
create {JSON_METADATA}.make_text_default
>>
end

convertible_features (a_object: ANY): ARRAY [STRING]
-- <Precursor>
once
Result := <<"summary","kind","start", "ending","id">>
end

end
Loading