Skip to content

Commit ae57467

Browse files
committed
Updated SpreedSheet objects
1 parent 8df10ff commit ae57467

24 files changed

+1080
-16
lines changed

sheets/src/json/eg_sheets_json.e

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ feature -- Implementation Factory
7373
Result.set_url (l_url)
7474
end
7575
Result.set_protperty (eg_spreadsheet_properties (a_json))
76+
if attached {JSON_ARRAY} json_value (a_json, "sheets") as l_sheets then
77+
across l_sheets as ic loop
78+
end
79+
end
80+
if attached {JSON_ARRAY} json_value (a_json, "namedRanges") as l_named_ranges then
81+
end
82+
if attached {JSON_ARRAY} json_value (a_json, "developerMetadata") as l_developer_metadata then
83+
-- TODO
84+
end
85+
7686

7787
end
7888

@@ -253,7 +263,11 @@ feature {NONE} -- JSON To Eiffel
253263
end
254264
end
255265

266+
eg_sheets (a_json: JSON_VALUE): EG_SHEET
267+
do
268+
create Result
256269

270+
end
257271

258272
feature {NONE} -- Implementation
259273

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
note
2+
description: "A banded (alternating colors) range in a sheet."
3+
date: "$Date$"
4+
revision: "$Revision$"
5+
EIS: "name=Banded Range", "src=https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/sheets#bandedrange", "protocol=uri"
6+
class
7+
EG_BANDED_RANGE
8+
9+
end
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
note
2+
description: "[
3+
The default filter associated with a sheet.
4+
5+
JSON representation
6+
{
7+
"range": {
8+
object (GridRange)
9+
},
10+
"sortSpecs": [
11+
{
12+
object (SortSpec)
13+
}
14+
],
15+
"criteria": {
16+
string: {
17+
object(FilterCriteria)
18+
},
19+
...
20+
}
21+
}
22+
23+
]"
24+
author: ""
25+
date: "$Date$"
26+
revision: "$Revision$"
27+
28+
class
29+
EG_BASIC_FILTER
30+
31+
end
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
note
2+
description: "[
3+
A rule describing a conditional format.
4+
5+
{
6+
"ranges": [
7+
{
8+
object (GridRange)
9+
}
10+
],
11+
12+
// Union field rule can be only one of the following:
13+
"booleanRule": {
14+
object (BooleanRule)
15+
},
16+
"gradientRule": {
17+
object (GradientRule)
18+
}
19+
// End of list of possible types for union field rule.
20+
}
21+
22+
]"
23+
date: "$Date$"
24+
revision: "$Revision$"
25+
EIS: "name=Conditional Format Rule", "src=https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/sheets#conditionalformatrule", "protocol=uri"
26+
27+
class
28+
EG_CONDITIONAL_FORMAT_RULE
29+
30+
end
Lines changed: 94 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,102 @@
11
note
2-
description: "Summary description for {EG_DEVELOPER_METADATA}."
2+
description: "[
3+
Developer metadata associated with a location or object in a spreadsheet.
4+
Developer metadata may be used to associate arbitrary data with various parts of a spreadsheet and will remain associated at those locations as they move around and the spreadsheet is edited.
5+
For example, if developer metadata is associated with row 5 and another row is then subsequently inserted above row 5, that original metadata will still be associated with the row
6+
it was first associated with (what is now row 6). If the associated object is deleted its metadata is deleted too.
7+
8+
9+
{
10+
"metadataId": integer,
11+
"metadataKey": string,
12+
"metadataValue": string,
13+
"location": {
14+
object (DeveloperMetadataLocation)
15+
},
16+
"visibility": enum (DeveloperMetadataVisibility)
17+
}
18+
19+
]"
320
date: "$Date$"
421
revision: "$Revision$"
22+
EIS: "name=Developer Metadata", "src=https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.developerMetadata#resource:-developermetadata", "protocol=uri"
523

624
class
725
EG_DEVELOPER_METADATA
826

27+
inherit
28+
ANY
29+
redefine
30+
default_create
31+
end
32+
33+
create
34+
default_create
35+
36+
feature {NONE} -- Initialize
37+
38+
default_create
39+
do
40+
create metadata_key.make_empty
41+
create metadata_value.make_empty
42+
create location
43+
create visibility
44+
end
45+
46+
feature -- Access
47+
48+
metadata_id: INTEGER
49+
-- The spreadsheet-scoped unique ID that identifies the metadata. IDs may be specified when metadata is created, otherwise one will be randomly generated and assigned. Must be positive.
50+
51+
metadata_key: STRING
52+
-- The metadata key. There may be multiple metadata in a spreadsheet with the same key. Developer metadata must always have a key specified.
53+
54+
metadata_value: STRING
55+
-- Data associated with the metadata's key.
56+
57+
location: EG_DEVELOPER_METADATA_LOCATION
58+
-- The location where the metadata is associated.
59+
60+
visibility: EG_DEVELOPER_METADATA_VISIBILITY
61+
-- The metadata visibility. Developer metadata must always have a visibility specified.
62+
63+
64+
feature -- Element Change
65+
66+
set_metadata_id (a_id: like metadata_id)
67+
do
68+
metadata_id := a_id
69+
ensure
70+
metadata_id_set: metadata_id = a_id
71+
end
72+
73+
set_metadata_key (a_key: like metadata_key)
74+
do
75+
metadata_key := a_key
76+
ensure
77+
metadata_key_set: metadata_key = a_key
78+
end
79+
80+
set_metadata_value (a_value: like metadata_value)
81+
do
82+
metadata_value := a_value
83+
ensure
84+
metadata_value_set: metadata_value = a_value
85+
end
86+
87+
set_location (a_location: like location)
88+
do
89+
location := a_location
90+
ensure
91+
location_set: location = a_location
92+
end
93+
94+
set_visibility (a_visibility: like visibility)
95+
do
96+
visibility := a_visibility
97+
ensure
98+
visibility_set: visibility = a_visibility
99+
end
100+
101+
9102
end
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
note
2+
description: "[
3+
A location where metadata may be associated in a spreadsheet.
4+
5+
{
6+
"locationType": enum (DeveloperMetadataLocationType),
7+
8+
// Union field location can be only one of the following:
9+
"spreadsheet": boolean,
10+
"sheetId": integer,
11+
"dimensionRange": {
12+
object (DimensionRange)
13+
}
14+
// End of list of possible types for union field location.
15+
}
16+
17+
]"
18+
date: "$Date$"
19+
revision: "$Revision$"
20+
EIS: "name=Developer Metadata Location", "src=https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.developerMetadata#developermetadatalocation", "protocol=uri"
21+
22+
class
23+
EG_DEVELOPER_METADATA_LOCATION
24+
25+
inherit
26+
27+
ANY
28+
redefine
29+
default_create
30+
end
31+
32+
create
33+
default_create
34+
35+
36+
feature {NONE} -- Initialization
37+
38+
default_create
39+
do
40+
create location_type
41+
end
42+
43+
feature -- Access
44+
45+
location_type: EG_DEVELOPER_METADATA_LOCATION_TYPE
46+
47+
48+
end
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
note
2+
description: "[
3+
An enumeration of the types of locations on which developer metadata may be associated.
4+
5+
DEVELOPER_METADATA_LOCATION_TYPE_UNSPECIFIED Default value.
6+
ROW Developer metadata associated on an entire row dimension.
7+
COLUMN Developer metadata associated on an entire column dimension.
8+
SHEET Developer metadata associated on an entire sheet.
9+
SPREADSHEET Developer metadata associated on the entire spreadsheet.
10+
]"
11+
date: "$Date$"
12+
revision: "$Revision$"
13+
EIS: "name", "src=https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.developerMetadata#developermetadatalocationtype", "protocol=uri"
14+
class
15+
EG_DEVELOPER_METADATA_LOCATION_TYPE
16+
17+
end
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
note
2+
description: "Summary description for {EG_DEVELOPER_METADATA_VISIBILITY}."
3+
author: ""
4+
date: "$Date$"
5+
revision: "$Revision$"
6+
7+
class
8+
EG_DEVELOPER_METADATA_VISIBILITY
9+
10+
end

sheets/src/objects/eg_dimension.e

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
note
2+
description: "[
3+
Indicates which dimension an operation should apply to.
4+
5+
DIMENSION_UNSPECIFIED The default value, do not use.
6+
ROWS Operates on the rows of a sheet.
7+
COLUMNS Operates on the columns of a sheet.
8+
]"
9+
date: "$Date$"
10+
revision: "$Revision$"
11+
12+
class
13+
EG_DIMENSION
14+
15+
end
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
note
2+
description: "[
3+
A group over an interval of rows or columns on a sheet, which can contain or be contained within other groups. A group can be collapsed or expanded as a unit on the sheet.
4+
5+
JSON representation
6+
{
7+
"range": {
8+
object (DimensionRange)
9+
},
10+
"depth": integer,
11+
"collapsed": boolean
12+
}
13+
]"
14+
date: "$Date$"
15+
revision: "$Revision$"
16+
EIS: "name=", "src=https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/sheets#dimensiongroup", "protocol=uri"
17+
class
18+
EG_DIMENSION_GROUP
19+
20+
end

0 commit comments

Comments
 (0)