diff --git a/cwms-data-api-client/src/test/java/mil/army/usace/hec/cwms/data/api/client/controllers/TestLevelController.java b/cwms-data-api-client/src/test/java/mil/army/usace/hec/cwms/data/api/client/controllers/TestLevelController.java index 77c2a04f..66c379a0 100644 --- a/cwms-data-api-client/src/test/java/mil/army/usace/hec/cwms/data/api/client/controllers/TestLevelController.java +++ b/cwms-data-api-client/src/test/java/mil/army/usace/hec/cwms/data/api/client/controllers/TestLevelController.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2024 Hydrologic Engineering Center + * Copyright (c) 2025 Hydrologic Engineering Center * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,12 +24,11 @@ package mil.army.usace.hec.cwms.data.api.client.controllers; -import mil.army.usace.hec.cwms.data.api.client.model.LocationLevel; -import mil.army.usace.hec.cwms.data.api.client.model.LocationLevels; -import mil.army.usace.hec.cwms.data.api.client.model.RadarObjectMapper; -import mil.army.usace.hec.cwms.data.api.client.model.SpecifiedLevel; -import mil.army.usace.hec.cwms.data.api.client.model.TimeSeries; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.time.Instant; @@ -38,8 +37,17 @@ import java.util.List; import java.util.Optional; import java.util.Set; - -import static org.junit.jupiter.api.Assertions.*; +import mil.army.usace.hec.cwms.data.api.client.model.ConstantLocationLevel; +import mil.army.usace.hec.cwms.data.api.client.model.LocationLevel; +import mil.army.usace.hec.cwms.data.api.client.model.LocationLevelConstituent; +import mil.army.usace.hec.cwms.data.api.client.model.LocationLevels; +import mil.army.usace.hec.cwms.data.api.client.model.RadarObjectMapper; +import mil.army.usace.hec.cwms.data.api.client.model.SeasonalLocationLevel; +import mil.army.usace.hec.cwms.data.api.client.model.SpecifiedLevel; +import mil.army.usace.hec.cwms.data.api.client.model.TimeSeries; +import mil.army.usace.hec.cwms.data.api.client.model.TimeSeriesLocationLevel; +import mil.army.usace.hec.cwms.data.api.client.model.VirtualLocationLevel; +import org.junit.jupiter.api.Test; class TestLevelController extends TestController { @@ -114,13 +122,51 @@ void testRetrieveLocationLevels() throws IOException { assertEquals("Top of Flood", level.get().getSpecifiedLevelId()); assertEquals(LocationLevel.ParameterTypeIdEnum.INST, level.get().getParameterTypeId()); assertEquals("Elev", level.get().getParameterId()); - assertEquals(321.564, level.get().getConstantValue()); + assertEquals(321.564, ((ConstantLocationLevel) level.get()).getConstantValue()); assertEquals("m", level.get().getLevelUnitsId()); ZonedDateTime effectiveDate = ZonedDateTime.of(1900, 1, 1, 5, 0, 0, 0, ZoneId.of("UTC")); assertEquals(effectiveDate.toInstant(), level.get().getLevelDate().toInstant()); assertEquals("0", level.get().getDurationId()); } + @Test + void testRetrieveLocationLevelSubtypes() throws IOException { + String resource = "radar/v2/json/location_levels.json"; + String collect = readJsonFile(resource); + mockHttpServer.enqueue(collect); + mockHttpServer.start(); + LocationLevelEndpointInput.GetAll input = LocationLevelEndpointInput.getAll() + .officeId("LRL"); + LocationLevels locationLevels = new LevelController().retrieveLocationLevels(buildConnectionInfo(), input); + assertTrue(locationLevels.getLevels().stream() + .anyMatch(l -> l instanceof VirtualLocationLevel)); + assertTrue(locationLevels.getLevels().stream() + .anyMatch(l -> l instanceof ConstantLocationLevel)); + assertTrue(locationLevels.getLevels().stream() + .anyMatch(l -> l instanceof TimeSeriesLocationLevel)); + assertTrue(locationLevels.getLevels().stream() + .anyMatch(l -> l instanceof SeasonalLocationLevel)); + } + + @Test + void testRetrieveVirtualLevel() throws IOException { + String resource = "radar/v2/json/location_levels.json"; + String collect = readJsonFile(resource); + mockHttpServer.enqueue(collect); + mockHttpServer.start(); + LocationLevelEndpointInput.GetAll input = LocationLevelEndpointInput.getAll() + .officeId("LRL"); + LocationLevels locationLevels = new LevelController().retrieveLocationLevels(buildConnectionInfo(), input); + VirtualLocationLevel virtualLevel = (VirtualLocationLevel) locationLevels.getLevels().stream() + .filter(l -> l instanceof VirtualLocationLevel) + .findAny() + .get(); + assertTrue(virtualLevel.getConstituents().stream() + .anyMatch(l -> !(l instanceof LocationLevelConstituent))); + assertTrue(virtualLevel.getConstituents().stream() + .anyMatch(l -> l instanceof LocationLevelConstituent)); + } + @Test void testRetrieveLocationLevel() throws IOException { String resource = "radar/v2/json/location_level.json"; @@ -135,10 +181,12 @@ void testRetrieveLocationLevel() throws IOException { assertEquals("Bottom of Inlet", level.getSpecifiedLevelId()); assertEquals(LocationLevel.ParameterTypeIdEnum.INST, level.getParameterTypeId()); assertEquals("Elev", level.getParameterId()); - assertEquals(145.6944, level.getConstantValue()); + assertEquals(145.6944, ((ConstantLocationLevel) level).getConstantValue()); assertEquals("m", level.getLevelUnitsId()); assertEquals(instant, level.getLevelDate().toInstant()); assertEquals("0", level.getDurationId()); + Instant expiration = Instant.parse("2900-01-01T06:00:00Z"); + assertEquals(expiration, level.getExpirationDate().toInstant()); } @Test @@ -175,7 +223,7 @@ void testLevelAsTimeSeries() throws IOException { String collect = readJsonFile(resource); mockHttpServer.enqueue(collect); mockHttpServer.start(); - LocationLevel locationLevel = RadarObjectMapper.mapJsonToObject(collect, LocationLevel.class); + LocationLevel locationLevel = RadarObjectMapper.mapJsonToObject(collect, TimeSeriesLocationLevel.class); Instant begin = Instant.parse("2023-06-01T07:00:00Z"); Instant end = Instant.parse("2023-06-11T07:00:00Z"); String unit = locationLevel.getLevelUnitsId(); diff --git a/cwms-data-api-client/src/test/resources/radar/v2/json/location_level.json b/cwms-data-api-client/src/test/resources/radar/v2/json/location_level.json index 729f80c9..3e4e5db2 100644 --- a/cwms-data-api-client/src/test/resources/radar/v2/json/location_level.json +++ b/cwms-data-api-client/src/test/resources/radar/v2/json/location_level.json @@ -7,5 +7,6 @@ "constant-value": 145.6944, "level-units-id": "m", "level-date": "1900-01-01T06:00:00Z", - "duration-id": "0" + "duration-id": "0", + "expiration-date": "2900-01-01T06:00:00Z" } \ No newline at end of file diff --git a/cwms-data-api-client/src/test/resources/radar/v2/json/location_levels.json b/cwms-data-api-client/src/test/resources/radar/v2/json/location_levels.json index 266f10c5..d0d28cbe 100644 --- a/cwms-data-api-client/src/test/resources/radar/v2/json/location_levels.json +++ b/cwms-data-api-client/src/test/resources/radar/v2/json/location_levels.json @@ -1102,6 +1102,54 @@ "level-units-id": "m3", "level-date": "1900-01-01T05:00:00Z", "duration-id": "0" + }, + { + "office-id": "SPK", + "location-level-id": "virtual_level_value_2.Stor.Ave.1Day.Regulating", + "level-units-id": "ac-ft", + "level-date": "2023-06-01T00:00:00-07:00", + "expiration-date": 1685689200000, + "constituents": [ + { + "type": "LOCATION_LEVEL", + "abbr": "L1", + "name": "level_get_all_loc3.Stage.Ave.1Day.Regulating", + "attribute-id": "Stage", + "attribute-value": 8.99 + }, + { + "type": "RATING", + "abbr": "R1", + "name": "LevelsControllerTestIT.Stage;Flow.COE.Production" + } + ], + "constituent-connections": "L1=R1I1" + }, + { + "seasonal-values": [ + { + "value": 10, + "offset-minutes": 0, + "offset-months": 0 + } + ], + "level-units-id": "ft", + "level-date": "2008-12-03T10:15:30+01:00[UTC]", + "level-comment": "for testing purposes", + "interval-origin": "2008-12-03T10:15:30+01:00[UTC]", + "interval-months": 1, + "interpolate-string": "false", + "location-level-id": "LOC_TEST.Elev.Inst.0.Bottom of Inlet", + "office-id": "LRL" + }, + { + "seasonal-time-series-id": "RYAN3.Stage.Inst.5Minutes.0.ZSTORE_TS_TEST630", + "level-units-id": "ft", + "level-date": "2008-12-03T10:15:30+01:00[UTC]", + "level-comment": "for testing purposes", + "interpolate-string": "false", + "location-level-id": "LOC_TEST.Elev.Inst.0.Bottom of Inlet", + "office-id": "LRL" } ] } \ No newline at end of file diff --git a/cwms-data-api-model/cwms-data-api-swagger.yaml b/cwms-data-api-model/cwms-data-api-swagger.yaml index 00e4fb66..b46f6dcf 100644 --- a/cwms-data-api-model/cwms-data-api-swagger.yaml +++ b/cwms-data-api-model/cwms-data-api-swagger.yaml @@ -2,9 +2,11 @@ openapi: 3.0.1 info: title: CWMS Data API description: CWMS REST API for Data Retrieval - version: 2025.03.20-security-update-tomcat + version: 2025.10.22-testa servers: - url: /cwms-data +security: + - CdaAccessManager: [ ] paths: /: get: @@ -44,6 +46,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /auth/keys/{key-name}: get: tags: @@ -98,6 +101,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Authorization @@ -150,6 +154,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /auth/keys: get: tags: @@ -199,6 +204,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Authorization @@ -250,6 +256,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /location/category/{category-id}: get: tags: @@ -310,6 +317,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Location Categories @@ -368,6 +376,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /location/category: get: tags: @@ -423,6 +432,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Location Categories @@ -469,6 +479,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /location/group/{group-id}: get: tags: @@ -553,6 +564,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Location Groups @@ -617,6 +629,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Location Groups @@ -680,6 +693,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /location/group: get: tags: @@ -762,6 +776,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Location Groups @@ -808,6 +823,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /locations/{location-id}: get: tags: @@ -878,6 +894,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Locations @@ -931,6 +948,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Locations @@ -986,6 +1004,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /locations: get: tags: @@ -1007,7 +1026,7 @@ paths: - name: unit in: query description: |- - Specifies the unit or unit system of the response. Valid values for the unit field are: + Specifies the unit or unit system of the response. Default is SI. Valid values for the unit field are: * `EN` Specifies English unit system. Location level values will be in the default English units for their parameters. * `SI` Specifies the SI unit system. Location level values will be in the default SI units for their parameters. * `Other` Any unit returned in the response to the units URI request that is appropriate for the requested parameters. @@ -1098,6 +1117,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Locations @@ -1153,6 +1173,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /states: get: tags: @@ -1201,6 +1222,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /counties: get: tags: @@ -1249,6 +1271,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /offices/{office}: get: tags: @@ -1326,6 +1349,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /offices: get: tags: @@ -1399,6 +1423,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /units: get: tags: @@ -1454,6 +1479,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /parameters: get: tags: @@ -1524,6 +1550,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timezones: get: tags: @@ -1586,6 +1613,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /levels/{level-id}: get: tags: @@ -1608,10 +1636,15 @@ paths: type: string - name: effective-date in: query - description: Specifies the effective date of Location Level to be returned. Expected formats are `YYYY-MM-DDTHH:MM` or `YYYY-MM-DDTHH:MM:SS` + description: Specifies the effective date of Location Level to be returned.Expected formats are `YYYY-MM-DDTHH:MM` or `YYYY-MM-DDTHH:MM:SS` required: true schema: type: string + - name: use-exact-effective-date + in: query + description: If true only a level with the exact provided date will be returned. If false The most recent level on or before this time will be returned. The default is false. + schema: + type: boolean - name: timezone in: query description: Specifies the time zone of the values of the effective date field (unless otherwise specified), as well as the time zone of any times in the response. If this field is not specified, the default time zone of UTC shall be used. @@ -1666,6 +1699,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Levels @@ -1733,6 +1767,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Levels @@ -1791,6 +1826,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /levels: get: tags: @@ -1909,6 +1945,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Levels @@ -1955,6 +1992,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /levels/{level-id}/timeseries: get: tags: @@ -2055,6 +2093,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/recent: get: tags: @@ -2132,6 +2171,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/filtered: get: tags: @@ -2267,6 +2307,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /standard-text-id/{standard-text-id}: get: tags: @@ -2327,6 +2368,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Standard Text @@ -2386,6 +2428,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /standard-text-id: get: tags: @@ -2444,6 +2487,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Standard Text @@ -2496,6 +2540,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/text: get: tags: @@ -2572,6 +2617,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Text-TimeSeries @@ -2624,6 +2670,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/text/{name}: delete: tags: @@ -2706,6 +2753,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Text-TimeSeries @@ -2764,6 +2812,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/text/{name}/value: get: tags: @@ -2845,6 +2894,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/binary: get: tags: @@ -2931,6 +2981,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Binary-TimeSeries @@ -2982,6 +3033,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/binary/{name}: delete: tags: @@ -3063,6 +3115,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Binary-TimeSeries @@ -3120,6 +3173,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/binary/{name}/value: get: tags: @@ -3202,6 +3256,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/profile/{location-id}/{parameter-id}: get: tags: @@ -3269,6 +3324,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - TimeSeries @@ -3330,6 +3386,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/profile: get: tags: @@ -3405,6 +3462,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - TimeSeries @@ -3455,6 +3513,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/profile-parser/{location-id}/{parameter-id}: get: tags: @@ -3525,6 +3584,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - TimeSeries @@ -3587,6 +3647,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/profile-parser: get: tags: @@ -3658,6 +3719,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - TimeSeries @@ -3712,6 +3774,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/profile-instance/{location-id}/{parameter-id}/{version}: get: tags: @@ -3853,6 +3916,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - TimeSeries @@ -3941,6 +4005,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/profile-instance: get: tags: @@ -4011,6 +4076,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - TimeSeries @@ -4089,6 +4155,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/category/{category-id}: get: tags: @@ -4151,6 +4218,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - TimeSeries Categories @@ -4209,6 +4277,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/category: get: tags: @@ -4266,6 +4335,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - TimeSeries Categories @@ -4318,6 +4388,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/identifier-descriptor/{name}: get: tags: @@ -4385,6 +4456,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - TimeSeries Identifier @@ -4449,6 +4521,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - TimeSeries Identifier @@ -4529,6 +4602,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/identifier-descriptor: get: tags: @@ -4600,6 +4674,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - TimeSeries Identifier @@ -4655,6 +4730,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/group/{group-id}: get: tags: @@ -4733,6 +4809,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Timeseries Groups @@ -4792,6 +4869,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Timeseries Groups @@ -4855,6 +4933,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/group: get: tags: @@ -4932,6 +5011,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Timeseries Groups @@ -4984,6 +5064,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries: get: tags: @@ -5135,6 +5216,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - TimeSeries @@ -5246,6 +5328,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /timeseries/{timeseries}: delete: tags: @@ -5341,6 +5424,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - TimeSeries @@ -5458,6 +5542,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /ratings/rate-values/{office}/{rating-id}: post: tags: @@ -5532,6 +5617,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /ratings/rate-ts/{office}/{rating-id}: post: tags: @@ -5606,6 +5692,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /ratings/reverse-rate-values/{office}/{rating-id}: post: tags: @@ -5680,6 +5767,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /ratings/reverse-rate-ts/{office}/{rating-id}: post: tags: @@ -5754,6 +5842,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /ratings/template/{template-id}: get: tags: @@ -5815,6 +5904,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Ratings @@ -5874,6 +5964,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /ratings/template: get: tags: @@ -5942,6 +6033,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Ratings @@ -5994,6 +6086,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /ratings/spec/{rating-id}: get: tags: @@ -6053,6 +6146,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Ratings @@ -6112,6 +6206,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /ratings/spec: get: tags: @@ -6180,6 +6275,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Ratings @@ -6232,6 +6328,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /ratings/metadata: get: tags: @@ -6315,6 +6412,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /ratings/{rating-id}/latest: get: tags: @@ -6378,6 +6476,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /ratings/effective-dates: get: tags: @@ -6451,6 +6550,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /ratings/{rating-id}: get: tags: @@ -6534,6 +6634,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Ratings @@ -6603,6 +6704,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Ratings @@ -6669,6 +6771,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /ratings: get: tags: @@ -6779,6 +6882,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Ratings @@ -6836,6 +6940,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /catalog/{dataset}: get: tags: @@ -6915,6 +7020,16 @@ paths: description: 'Posix regular expression matching against the location kind. The location-kind is typically unset or one of the following: {"SITE", "EMBANKMENT", "OVERFLOW", "TURBINE", "STREAM", "PROJECT", "STREAMGAGE", "BASIN", "OUTLET", "LOCK", "GATE"}. Multiple kinds can be matched by using Regular Expression OR clauses. For example: "(SITE|STREAM)"' schema: type: string + - name: filter-base-locations + in: query + description: 'Specifies whether to filter the locations based on the base location. Default: false. If true, only sublocations locations will be returned. If false, all locations will be returned. Only supported for JSON format.' + schema: + type: boolean + - name: negate-location-kind-like + in: query + description: Whether to use the location kind regular expression to exclude locations with the specified kinds. Default is false. + schema: + type: string - name: location-type-like in: query description: Posix regular expression matching against the location type. @@ -6968,6 +7083,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /basins/{name}: get: tags: @@ -7045,6 +7161,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Basins @@ -7104,6 +7221,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Basins @@ -7164,6 +7282,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /basins: get: tags: @@ -7233,6 +7352,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Basins @@ -7277,6 +7397,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /streams/{name}: get: tags: @@ -7349,6 +7470,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Streams @@ -7409,6 +7531,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Streams @@ -7469,6 +7592,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /streams: get: tags: @@ -7549,6 +7673,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Streams @@ -7603,6 +7728,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /stream-locations/{office}/{name}/downstream-locations: get: tags: @@ -7690,6 +7816,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /stream-locations/{office}/{name}/upstream-locations: get: tags: @@ -7777,6 +7904,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /stream-locations/{name}: get: tags: @@ -7865,6 +7993,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - StreamLocations @@ -7926,6 +8055,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - StreamLocations @@ -7980,6 +8110,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /stream-locations: get: tags: @@ -8065,6 +8196,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - StreamLocations @@ -8119,6 +8251,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /stream-reaches/{name}: get: tags: @@ -8197,6 +8330,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - StreamReaches @@ -8252,6 +8386,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - StreamReaches @@ -8312,6 +8447,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /stream-reaches: get: tags: @@ -8392,6 +8528,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - StreamReaches @@ -8446,6 +8583,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /measurements/time-extents: get: tags: @@ -8501,6 +8639,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /measurements: get: tags: @@ -8629,6 +8768,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Measurements @@ -8690,6 +8830,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /measurements/{location-id}: delete: tags: @@ -8773,6 +8914,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /blobs/{blob-id}: get: tags: @@ -8825,6 +8967,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Blob @@ -8878,6 +9021,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Blob @@ -8934,6 +9078,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /blobs: get: tags: @@ -9005,6 +9150,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Blob @@ -9057,6 +9203,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /clobs/{clob-id}: get: tags: @@ -9123,6 +9270,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Clob @@ -9176,6 +9324,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Clob @@ -9237,6 +9386,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /clobs: get: tags: @@ -9313,6 +9463,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Clob @@ -9368,6 +9519,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /pools/{pool-id}: get: tags: @@ -9456,6 +9608,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /pools: get: tags: @@ -9552,6 +9705,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /specified-levels: get: tags: @@ -9609,6 +9763,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Levels @@ -9661,6 +9816,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /specified-levels/{specified-level-id}: delete: tags: @@ -9715,6 +9871,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Levels @@ -9773,6 +9930,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /forecast-instance/{name}: get: tags: @@ -9852,6 +10010,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Forecast @@ -9922,6 +10081,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Forecast @@ -9975,6 +10135,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /forecast-instance: get: tags: @@ -10040,6 +10201,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Forecast @@ -10086,6 +10248,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /forecast-spec/{name}: get: tags: @@ -10153,6 +10316,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Forecast @@ -10216,6 +10380,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Forecast @@ -10269,6 +10434,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /forecast-spec: get: tags: @@ -10339,6 +10505,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Forecast @@ -10385,6 +10552,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /forecast-instance/{name}/file-data: get: tags: @@ -10465,6 +10633,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/status-update/{name}: post: tags: @@ -10547,6 +10716,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/{office}/{project-id}/water-user/{water-user}: get: tags: @@ -10613,6 +10783,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Water Contracts @@ -10677,6 +10848,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Water Contracts @@ -10752,6 +10924,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/{office}/{project-id}/water-user: get: tags: @@ -10812,6 +10985,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Water Contracts @@ -10878,6 +11052,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/{office}/{project-id}/water-user/{water-user}/contracts/{contract-name}: get: tags: @@ -10955,6 +11130,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Water Contracts @@ -11025,6 +11201,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Water Contracts @@ -11105,6 +11282,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/{office}/{project-id}/water-user/{water-user}/contracts: get: tags: @@ -11176,6 +11354,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Water Contracts @@ -11255,6 +11434,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/{office}/{project-id}/water-user/{water-user}/contracts/{contract-name}/accounting: get: tags: @@ -11379,6 +11559,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Pump Accounting @@ -11453,6 +11634,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/{office}/{project-id}/water-user/{water-user}/contracts/{contract-name}/pumps/{name}: delete: tags: @@ -11536,6 +11718,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/{office}/contract-types: get: tags: @@ -11595,6 +11778,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Water Contracts @@ -11656,6 +11840,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/{office}/contract-types/{display-value}: delete: tags: @@ -11710,6 +11895,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/embankments/{name}: get: tags: @@ -11777,6 +11963,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Embankments @@ -11837,6 +12024,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Embankments @@ -11897,6 +12085,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/embankments: get: tags: @@ -11963,6 +12152,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Embankments @@ -12017,6 +12207,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/turbines/{name}: get: tags: @@ -12080,6 +12271,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Turbines @@ -12140,6 +12332,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Turbines @@ -12200,6 +12393,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/turbines: get: tags: @@ -12265,6 +12459,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Turbines @@ -12322,6 +12517,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/locks/{name}: get: tags: @@ -12398,6 +12594,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Locks @@ -12458,6 +12655,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Locks @@ -12518,6 +12716,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/locks: get: tags: @@ -12585,6 +12784,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Locks @@ -12639,6 +12839,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/{office}/{name}/turbine-changes: get: tags: @@ -12734,6 +12935,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Turbines @@ -12803,6 +13005,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Turbines @@ -12875,6 +13078,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/outlets/{name}: get: tags: @@ -12938,6 +13142,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Outlets @@ -12998,6 +13203,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Outlets @@ -13058,6 +13264,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/outlets: get: tags: @@ -13125,6 +13332,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Outlets @@ -13182,6 +13390,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/gate-changes: post: tags: @@ -13244,6 +13453,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/{office}/{project-id}/gate-changes: get: tags: @@ -13344,6 +13554,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Outlets @@ -13416,6 +13627,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/{office}/{project-id}/virtual-outlets/{name}: get: tags: @@ -13485,6 +13697,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Outlets @@ -13551,6 +13764,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/{office}/{project-id}/virtual-outlets: get: tags: @@ -13618,6 +13832,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/virtual-outlets: post: tags: @@ -13676,6 +13891,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/locations: get: tags: @@ -13741,6 +13957,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects/{name}: get: tags: @@ -13803,6 +14020,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Projects @@ -13861,6 +14079,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Projects @@ -13927,6 +14146,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /projects: get: tags: @@ -13998,6 +14218,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Projects @@ -14053,6 +14274,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /properties/{name}: get: tags: @@ -14124,6 +14346,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Properties @@ -14185,6 +14408,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - Properties @@ -14239,6 +14463,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /properties: get: tags: @@ -14304,6 +14529,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Properties @@ -14352,6 +14578,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /lookup-types: get: tags: @@ -14420,6 +14647,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - LookupTypes @@ -14481,6 +14709,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /lookup-types/{name}: delete: tags: @@ -14548,6 +14777,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] patch: tags: - LookupTypes @@ -14614,6 +14844,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /project-locks/{name}: get: tags: @@ -14680,6 +14911,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - Project Locks @@ -14739,6 +14971,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /project-locks: get: tags: @@ -14803,6 +15036,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] post: tags: - Project Locks @@ -14868,6 +15102,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /project-locks/deny: post: tags: @@ -14916,6 +15151,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /project-locks/release: post: tags: @@ -14970,6 +15206,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /project-lock-rights: get: tags: @@ -15036,6 +15273,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /project-lock-rights/remove-all: post: tags: @@ -15096,6 +15334,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /project-lock-rights/update: post: tags: @@ -15167,6 +15406,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /users/{user-name}: get: tags: @@ -15221,6 +15461,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /users: get: tags: @@ -15286,6 +15527,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /roles: get: tags: @@ -15335,6 +15577,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /user/profile: get: tags: @@ -15382,6 +15625,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] /user/{user-name}/roles/{office-id}: post: tags: @@ -15445,6 +15689,7 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] delete: tags: - User Management @@ -15507,6 +15752,42 @@ paths: security: - ApiKey: [] - CwmsAAACacAuth: [] + - OpenIDConnect: [ ] + /*: + options: + summary: Options with wildcard + operationId: optionsWithWildcard + responses: + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/CdaError' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/CdaError' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/CdaError' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/CdaError' + '500': + description: Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/CdaError' components: schemas: CdaError: @@ -16361,13 +16642,8 @@ components: seconds: type: integer format: int64 - nano: - type: integer - format: int32 zero: type: boolean - negative: - type: boolean units: type: array items: @@ -16381,17 +16657,22 @@ components: seconds: type: integer format: int64 - nano: - type: integer - format: int32 zero: type: boolean negative: type: boolean + nano: + type: integer + format: int32 durationEstimated: type: boolean dateBased: type: boolean + negative: + type: boolean + nano: + type: integer + format: int32 description: The interval of the time-series, in ISO-8601 duration format format: Java Duration readOnly: true @@ -16513,13 +16794,8 @@ components: seconds: type: integer format: int64 - nano: - type: integer - format: int32 zero: type: boolean - negative: - type: boolean units: type: array items: @@ -16533,17 +16809,22 @@ components: seconds: type: integer format: int64 - nano: - type: integer - format: int32 zero: type: boolean negative: type: boolean + nano: + type: integer + format: int32 durationEstimated: type: boolean dateBased: type: boolean + negative: + type: boolean + nano: + type: integer + format: int32 description: The interval of the time-series, in ISO-8601 duration format format: Java Duration readOnly: true @@ -18205,10 +18486,10 @@ components: PoolNameType: type: object properties: - poolName: - type: string officeId: type: string + poolName: + type: string pools: type: object properties: @@ -19108,8 +19389,123 @@ components: description: 'Key value as generated from the /auth/keys endpoint. NOTE: you MUST manually prefix your key with ''apikey '' (without the single quotes).' name: Authorization in: header + scheme: apikey CwmsAAACacAuth: type: apiKey description: Auth handler running on same tomcat instance as the data api. name: JSESSIONIDSSO in: cookie + OpenIDConnect: + type: openIdConnect + name: Authorization + in: header + flows: + implicit: + authorizationUrl: https://identityc-test.cwbi.us/auth/realms/cwbi/protocol/openid-connect/auth + tokenUrl: https://identityc-test.cwbi.us/auth/realms/cwbi/protocol/openid-connect/token + scopes: + openid: '' + stig-manager:collection:read: '' + stig-manager:op: '' + x509_presented: '' + stig-manager:op:read: '' + email: '' + stig-manager:collection: '' + microprofile-jwt: '' + address: '' + acr: '' + profile: '' + groups: '' + stig-manager:stig: '' + roles: '' + web-origins: '' + stig-manager:stig:read: '' + offline_access: '' + cacUID: '' + preferred_username: '' + stig-manager:user:read: '' + phone: '' + subjectDN: '' + stig-manager:user: '' + password: + authorizationUrl: https://identityc-test.cwbi.us/auth/realms/cwbi/protocol/openid-connect/auth + tokenUrl: https://identityc-test.cwbi.us/auth/realms/cwbi/protocol/openid-connect/token + scopes: + openid: '' + stig-manager:collection:read: '' + stig-manager:op: '' + x509_presented: '' + stig-manager:op:read: '' + email: '' + stig-manager:collection: '' + microprofile-jwt: '' + address: '' + acr: '' + profile: '' + groups: '' + stig-manager:stig: '' + roles: '' + web-origins: '' + stig-manager:stig:read: '' + offline_access: '' + cacUID: '' + preferred_username: '' + stig-manager:user:read: '' + phone: '' + subjectDN: '' + stig-manager:user: '' + clientCredentials: + authorizationUrl: https://identityc-test.cwbi.us/auth/realms/cwbi/protocol/openid-connect/auth + tokenUrl: https://identityc-test.cwbi.us/auth/realms/cwbi/protocol/openid-connect/token + scopes: + openid: '' + stig-manager:collection:read: '' + stig-manager:op: '' + x509_presented: '' + stig-manager:op:read: '' + email: '' + stig-manager:collection: '' + microprofile-jwt: '' + address: '' + acr: '' + profile: '' + groups: '' + stig-manager:stig: '' + roles: '' + web-origins: '' + stig-manager:stig:read: '' + offline_access: '' + cacUID: '' + preferred_username: '' + stig-manager:user:read: '' + phone: '' + subjectDN: '' + stig-manager:user: '' + authorizationCode: + authorizationUrl: https://identityc-test.cwbi.us/auth/realms/cwbi/protocol/openid-connect/auth + tokenUrl: https://identityc-test.cwbi.us/auth/realms/cwbi/protocol/openid-connect/token + scopes: + openid: '' + stig-manager:collection:read: '' + stig-manager:op: '' + x509_presented: '' + stig-manager:op:read: '' + email: '' + stig-manager:collection: '' + microprofile-jwt: '' + address: '' + acr: '' + profile: '' + groups: '' + stig-manager:stig: '' + roles: '' + web-origins: '' + stig-manager:stig:read: '' + offline_access: '' + cacUID: '' + preferred_username: '' + stig-manager:user:read: '' + phone: '' + subjectDN: '' + stig-manager:user: '' + openIdConnectUrl: https://identityc-test.cwbi.us/auth/realms/cwbi/.well-known/openid-configuration diff --git a/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/ConstantLocationLevel.java b/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/ConstantLocationLevel.java new file mode 100644 index 00000000..fb71a1ad --- /dev/null +++ b/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/ConstantLocationLevel.java @@ -0,0 +1,100 @@ +/* + * MIT License + * + * Copyright (c) 2025 Hydrologic Engineering Center + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package mil.army.usace.hec.cwms.data.api.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.Objects; + +/** + * ConstantLocationLevel + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2025-11-12T16:30:51.643037900-08:00[America/Los_Angeles]") +@JsonDeserialize() +public class ConstantLocationLevel extends LocationLevel { + + @JsonProperty("constant-value") + private Double constantValue = null; + + public ConstantLocationLevel constantValue(Double constantValue) { + this.constantValue = constantValue; + return this; + } + + public Double getConstantValue() { + return constantValue; + } + + public void setConstantValue(Double constantValue) { + this.constantValue = constantValue; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConstantLocationLevel constantLocationLevel = (ConstantLocationLevel) o; + return super.equals(o) && Objects.equals(this.constantValue, constantLocationLevel.constantValue); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), constantValue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConstantLocationLevel {\n"); + + sb.append(" officeId: ").append(toIndentedString(getOfficeId())).append("\n"); + sb.append(" locationLevelId: ").append(toIndentedString(getLocationLevelId())).append("\n"); + sb.append(" specifiedLevelId: ").append(toIndentedString(getSpecifiedLevelId())).append("\n"); + sb.append(" expirationDate: ").append(toIndentedString(getExpirationDate())).append("\n"); + sb.append(" parameterId: ").append(toIndentedString(getParameterId())).append("\n"); + sb.append(" parameterTypeId: ").append(toIndentedString(getParameterTypeId())).append("\n"); + sb.append(" interpolateString: ").append(toIndentedString(getInterpolateString())).append("\n"); + sb.append(" levelUnitsId: ").append(toIndentedString(getLevelUnitsId())).append("\n"); + sb.append(" levelDate: ").append(toIndentedString(getLevelDate())).append("\n"); + sb.append(" levelComment: ").append(toIndentedString(getLevelComment())).append("\n"); + sb.append(" durationId: ").append(toIndentedString(getDurationId())).append("\n"); + sb.append(" attributeValue: ").append(toIndentedString(getAttributeValue())).append("\n"); + sb.append(" attributeUnitsId: ").append(toIndentedString(getAttributeUnitsId())).append("\n"); + sb.append(" attributeParameterTypeId: ").append(toIndentedString(getAttributeParameterTypeId())) + .append("\n"); + sb.append(" attributeParameterId: ").append(toIndentedString(getAttributeParameterId())).append("\n"); + sb.append(" attributeDurationId: ").append(toIndentedString(getAttributeDurationId())).append("\n"); + sb.append(" attributeComment: ").append(toIndentedString(getAttributeComment())).append("\n"); + sb.append(" constantValue: ").append(toIndentedString(constantValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/LocationLevel.java b/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/LocationLevel.java index 4ec96f73..10087089 100644 --- a/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/LocationLevel.java +++ b/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/LocationLevel.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2024 Hydrologic Engineering Center + * Copyright (c) 2025 Hydrologic Engineering Center * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -28,38 +28,35 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonValue; -import jakarta.annotation.Generated; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotNull; - +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.math.BigDecimal; import java.time.ZonedDateTime; -import java.util.ArrayList; -import java.util.List; import java.util.Objects; +import mil.army.usace.hec.cwms.data.api.client.model.util.LocationLevelDeserializer; /** * LocationLevel */ @JsonIgnoreProperties(ignoreUnknown = true) -@Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2022-08-11T12:56:36.285-07:00[America/Los_Angeles]") -public class LocationLevel { - @JsonProperty("location-level-id") - private String locationLevelId = null; +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2025-11-12T16:30:51.643037900-08:00[America/Los_Angeles]") +@JsonDeserialize(using = LocationLevelDeserializer.class) +public abstract class LocationLevel { @JsonProperty("office-id") private String officeId = null; - @JsonProperty("seasonal-time-series-id") - private String seasonalTimeSeriesId = null; - - @JsonProperty("seasonal-values") - @Valid - private List seasonalValues = new ArrayList<>(); + @JsonProperty("location-level-id") + private String locationLevelId = null; @JsonProperty("specified-level-id") private String specifiedLevelId = null; + @JsonProperty("expiration-date") + private ZonedDateTime expirationDate = null; + + @JsonProperty("parameter-id") + private String parameterId = null; + /** * To indicate if single or aggregate value */ @@ -74,7 +71,7 @@ public enum ParameterTypeIdEnum { TOTAL("Total"); - private String value; + private final String value; ParameterTypeIdEnum(String value) { this.value = value; @@ -100,30 +97,6 @@ public static ParameterTypeIdEnum fromValue(String text) { @JsonProperty("parameter-type-id") private ParameterTypeIdEnum parameterTypeId = null; - @JsonProperty("parameter-id") - private String parameterId = null; - - @JsonProperty("constant-value") - private Double constantValue = null; - - @JsonProperty("level-units-id") - private String levelUnitsId = null; - - @JsonProperty("level-date") - private ZonedDateTime levelDate = null; - - @JsonProperty("level-comment") - private String levelComment = null; - - @JsonProperty("interval-origin") - private ZonedDateTime intervalOrigin = null; - - @JsonProperty("interval-months") - private Integer intervalMonths = null; - - @JsonProperty("interval-minutes") - private Integer intervalMinutes = null; - /** * Indicating whether or not to interpolate between seasonal values. */ @@ -132,7 +105,7 @@ public enum InterpolateStringEnum { F("F"); - private String value; + private final String value; InterpolateStringEnum(String value) { this.value = value; @@ -158,6 +131,15 @@ public static InterpolateStringEnum fromValue(String text) { @JsonProperty("interpolate-string") private InterpolateStringEnum interpolateString = null; + @JsonProperty("level-units-id") + private String levelUnitsId = null; + + @JsonProperty("level-date") + private ZonedDateTime levelDate = null; + + @JsonProperty("level-comment") + private String levelComment = null; + @JsonProperty("duration-id") private String durationId = null; @@ -179,38 +161,11 @@ public static InterpolateStringEnum fromValue(String text) { @JsonProperty("attribute-comment") private String attributeComment = null; - public LocationLevel locationLevelId(String locationLevelId) { - this.locationLevelId = locationLevelId; - return this; - } - - /** - * Name of the location level - * - * @return locationLevelId - **/ - @NotNull - - public String getLocationLevelId() { - return locationLevelId; - } - - public void setLocationLevelId(String locationLevelId) { - this.locationLevelId = locationLevelId; - } - public LocationLevel officeId(String officeId) { this.officeId = officeId; return this; } - /** - * Owning office of the level - * - * @return officeId - **/ - @NotNull - public String getOfficeId() { return officeId; } @@ -219,50 +174,17 @@ public void setOfficeId(String officeId) { this.officeId = officeId; } - public LocationLevel seasonalTimeSeriesId(String seasonalTimeSeriesId) { - this.seasonalTimeSeriesId = seasonalTimeSeriesId; - return this; - } - - /** - * Timeseries ID (e.g. from the times series catalog) to use as the location level. Mutually exclusive with seasonalValues and siParameterUnitsConstantValue - * - * @return seasonalTimeSeriesId - **/ - - public String getSeasonalTimeSeriesId() { - return seasonalTimeSeriesId; - } - - public void setSeasonalTimeSeriesId(String seasonalTimeSeriesId) { - this.seasonalTimeSeriesId = seasonalTimeSeriesId; - } - - public LocationLevel seasonalValues(List seasonalValues) { - this.seasonalValues = seasonalValues; - return this; - } - - public LocationLevel addSeasonalValuesItem(SeasonalValueBean seasonalValuesItem) { - if (this.seasonalValues == null) { - this.seasonalValues = new ArrayList(); - } - this.seasonalValues.add(seasonalValuesItem); + public LocationLevel locationLevelId(String locationLevelId) { + this.locationLevelId = locationLevelId; return this; } - /** - * List of Repeating seasonal values. The values repeater after the specified interval. A yearly interval seasonable could have 12 different values, one for each month for example. Mutually exclusive with seasonalTimeSeriesId and siParameterUnitsConstantValue - * - * @return seasonalValues - **/ - @Valid - public List getSeasonalValues() { - return seasonalValues; + public String getLocationLevelId() { + return locationLevelId; } - public void setSeasonalValues(List seasonalValues) { - this.seasonalValues = seasonalValues; + public void setLocationLevelId(String locationLevelId) { + this.locationLevelId = locationLevelId; } public LocationLevel specifiedLevelId(String specifiedLevelId) { @@ -270,12 +192,6 @@ public LocationLevel specifiedLevelId(String specifiedLevelId) { return this; } - /** - * Generic name of this location level. Common names are 'Top of Dam', 'Streambed', 'Bottom of Dam'. - * - * @return specifiedLevelId - **/ - public String getSpecifiedLevelId() { return specifiedLevelId; } @@ -284,23 +200,17 @@ public void setSpecifiedLevelId(String specifiedLevelId) { this.specifiedLevelId = specifiedLevelId; } - public LocationLevel parameterTypeId(ParameterTypeIdEnum parameterTypeId) { - this.parameterTypeId = parameterTypeId; + public LocationLevel expirationDate(ZonedDateTime expirationDate) { + this.expirationDate = expirationDate; return this; } - /** - * To indicate if single or aggregate value - * - * @return parameterTypeId - **/ - - public ParameterTypeIdEnum getParameterTypeId() { - return parameterTypeId; + public ZonedDateTime getExpirationDate() { + return expirationDate; } - public void setParameterTypeId(ParameterTypeIdEnum parameterTypeId) { - this.parameterTypeId = parameterTypeId; + public void setExpirationDate(ZonedDateTime expirationDate) { + this.expirationDate = expirationDate; } public LocationLevel parameterId(String parameterId) { @@ -308,12 +218,6 @@ public LocationLevel parameterId(String parameterId) { return this; } - /** - * Data Type such as Stage, Elevation, or others. - * - * @return parameterId - **/ - public String getParameterId() { return parameterId; } @@ -322,23 +226,30 @@ public void setParameterId(String parameterId) { this.parameterId = parameterId; } - public LocationLevel constantValue(Double constantValue) { - this.constantValue = constantValue; + public LocationLevel parameterTypeId(ParameterTypeIdEnum parameterTypeId) { + this.parameterTypeId = parameterTypeId; return this; } - /** - * Single value for this location level. Mutually exclusive with seasonableTimeSeriesId and seasonValues. - * - * @return constantValue - **/ + public ParameterTypeIdEnum getParameterTypeId() { + return parameterTypeId; + } + + public void setParameterTypeId(ParameterTypeIdEnum parameterTypeId) { + this.parameterTypeId = parameterTypeId; + } + + public LocationLevel interpolateString(InterpolateStringEnum interpolateString) { + this.interpolateString = interpolateString; + return this; + } - public Double getConstantValue() { - return constantValue; + public InterpolateStringEnum getInterpolateString() { + return interpolateString; } - public void setConstantValue(Double constantValue) { - this.constantValue = constantValue; + public void setInterpolateString(InterpolateStringEnum interpolateString) { + this.interpolateString = interpolateString; } public LocationLevel levelUnitsId(String levelUnitsId) { @@ -346,12 +257,6 @@ public LocationLevel levelUnitsId(String levelUnitsId) { return this; } - /** - * Units thhe provided levels are in - * - * @return levelUnitsId - **/ - public String getLevelUnitsId() { return levelUnitsId; } @@ -365,13 +270,6 @@ public LocationLevel levelDate(ZonedDateTime levelDate) { return this; } - /** - * The date/time at which this location level configuration takes effect. - * - * @return levelDate - **/ - - @Valid public ZonedDateTime getLevelDate() { return levelDate; } @@ -385,12 +283,6 @@ public LocationLevel levelComment(String levelComment) { return this; } - /** - * Get levelComment - * - * @return levelComment - **/ - public String getLevelComment() { return levelComment; } @@ -399,94 +291,11 @@ public void setLevelComment(String levelComment) { this.levelComment = levelComment; } - public LocationLevel intervalOrigin(ZonedDateTime intervalOrigin) { - this.intervalOrigin = intervalOrigin; - return this; - } - - /** - * The start point of provided seasonal values - * - * @return intervalOrigin - **/ - - @Valid - public ZonedDateTime getIntervalOrigin() { - return intervalOrigin; - } - - public void setIntervalOrigin(ZonedDateTime intervalOrigin) { - this.intervalOrigin = intervalOrigin; - } - - public LocationLevel intervalMonths(Integer intervalMonths) { - this.intervalMonths = intervalMonths; - return this; - } - - /** - * Get intervalMonths - * - * @return intervalMonths - **/ - - public Integer getIntervalMonths() { - return intervalMonths; - } - - public void setIntervalMonths(Integer intervalMonths) { - this.intervalMonths = intervalMonths; - } - - public LocationLevel intervalMinutes(Integer intervalMinutes) { - this.intervalMinutes = intervalMinutes; - return this; - } - - /** - * Get intervalMinutes - * - * @return intervalMinutes - **/ - - public Integer getIntervalMinutes() { - return intervalMinutes; - } - - public void setIntervalMinutes(Integer intervalMinutes) { - this.intervalMinutes = intervalMinutes; - } - - public LocationLevel interpolateString(InterpolateStringEnum interpolateString) { - this.interpolateString = interpolateString; - return this; - } - - /** - * Indicating whether or not to interpolate between seasonal values. - * - * @return interpolateString - **/ - - public InterpolateStringEnum getInterpolateString() { - return interpolateString; - } - - public void setInterpolateString(InterpolateStringEnum interpolateString) { - this.interpolateString = interpolateString; - } - public LocationLevel durationId(String durationId) { this.durationId = durationId; return this; } - /** - * 0 if parameterTypeId is Inst. Otherwise duration indicating the time window of the aggregate value. - * - * @return durationId - **/ - public String getDurationId() { return durationId; } @@ -500,13 +309,6 @@ public LocationLevel attributeValue(BigDecimal attributeValue) { return this; } - /** - * Get attributeValue - * - * @return attributeValue - **/ - - @Valid public BigDecimal getAttributeValue() { return attributeValue; } @@ -520,12 +322,6 @@ public LocationLevel attributeUnitsId(String attributeUnitsId) { return this; } - /** - * Get attributeUnitsId - * - * @return attributeUnitsId - **/ - public String getAttributeUnitsId() { return attributeUnitsId; } @@ -539,12 +335,6 @@ public LocationLevel attributeParameterTypeId(String attributeParameterTypeId) { return this; } - /** - * Get attributeParameterTypeId - * - * @return attributeParameterTypeId - **/ - public String getAttributeParameterTypeId() { return attributeParameterTypeId; } @@ -558,12 +348,6 @@ public LocationLevel attributeParameterId(String attributeParameterId) { return this; } - /** - * Get attributeParameterId - * - * @return attributeParameterId - **/ - public String getAttributeParameterId() { return attributeParameterId; } @@ -577,12 +361,6 @@ public LocationLevel attributeDurationId(String attributeDurationId) { return this; } - /** - * Get attributeDurationId - * - * @return attributeDurationId - **/ - public String getAttributeDurationId() { return attributeDurationId; } @@ -596,12 +374,6 @@ public LocationLevel attributeComment(String attributeComment) { return this; } - /** - * Get attributeComment - * - * @return attributeComment - **/ - public String getAttributeComment() { return attributeComment; } @@ -610,73 +382,87 @@ public void setAttributeComment(String attributeComment) { this.attributeComment = attributeComment; } - @Override public boolean equals(Object o) { if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { - return false; - } LocationLevel locationLevel = (LocationLevel) o; - return this.locationLevelId == null || locationLevel.locationLevelId == null ? - Objects.equals(this.locationLevelId, locationLevel.locationLevelId) : - this.locationLevelId.equalsIgnoreCase(locationLevel.locationLevelId) && this.officeId == null || locationLevel.officeId == null ? - Objects.equals(this.officeId, locationLevel.officeId) : - this.officeId.equalsIgnoreCase(locationLevel.officeId) && this.seasonalTimeSeriesId == null || - locationLevel.seasonalTimeSeriesId == null ? Objects.equals(this.seasonalTimeSeriesId, locationLevel.seasonalTimeSeriesId) : - this.seasonalTimeSeriesId.equalsIgnoreCase(locationLevel.seasonalTimeSeriesId) && - Objects.equals(this.seasonalValues, locationLevel.seasonalValues) && this.specifiedLevelId == null || - locationLevel.specifiedLevelId == null ? Objects.equals(this.specifiedLevelId, locationLevel.specifiedLevelId) : - this.specifiedLevelId.equalsIgnoreCase(locationLevel.specifiedLevelId) && this.parameterTypeId == null || - locationLevel.parameterTypeId == null ? Objects.equals(this.parameterTypeId, locationLevel.parameterTypeId) : - this.parameterTypeId.equals(locationLevel.parameterTypeId) && this.parameterId == null || - locationLevel.parameterId == null ? Objects.equals(this.parameterId, locationLevel.parameterId) : - this.parameterId.equalsIgnoreCase(locationLevel.parameterId) && - Objects.equals(this.constantValue, locationLevel.constantValue) && this.levelUnitsId == null || - locationLevel.levelUnitsId == null ? Objects.equals(this.levelUnitsId, locationLevel.levelUnitsId) : - this.levelUnitsId.equalsIgnoreCase(locationLevel.levelUnitsId) && - Objects.equals(this.levelDate, locationLevel.levelDate) && this.levelComment == null || - locationLevel.levelComment == null ? Objects.equals(this.levelComment, locationLevel.levelComment) : - this.levelComment.equalsIgnoreCase(locationLevel.levelComment) && - Objects.equals(this.intervalOrigin, locationLevel.intervalOrigin) && - Objects.equals(this.intervalMonths, locationLevel.intervalMonths) && - Objects.equals(this.intervalMinutes, locationLevel.intervalMinutes) && this.interpolateString == null || - locationLevel.interpolateString == null ? - Objects.equals(this.interpolateString, locationLevel.interpolateString) : - this.interpolateString.equals(locationLevel.interpolateString) && this.durationId == null || - locationLevel.durationId == null ? Objects.equals(this.durationId, locationLevel.durationId) : - this.durationId.equalsIgnoreCase(locationLevel.durationId) && - Objects.equals(this.attributeValue, locationLevel.attributeValue) && - this.attributeUnitsId == null || locationLevel.attributeUnitsId == null ? - Objects.equals(this.attributeUnitsId, locationLevel.attributeUnitsId) : - this.attributeUnitsId.equalsIgnoreCase(locationLevel.attributeUnitsId) && - this.attributeParameterTypeId == null || locationLevel.attributeParameterTypeId == null ? - Objects.equals(this.attributeParameterTypeId, locationLevel.attributeParameterTypeId) : - this.attributeParameterTypeId.equalsIgnoreCase(locationLevel.attributeParameterTypeId) && - this.attributeParameterId == null || locationLevel.attributeParameterId == null ? - Objects.equals(this.attributeParameterId, locationLevel.attributeParameterId) : - this.attributeParameterId.equalsIgnoreCase(locationLevel.attributeParameterId) && - this.attributeDurationId == null || locationLevel.attributeDurationId == null ? - Objects.equals(this.attributeDurationId, locationLevel.attributeDurationId) : - this.attributeDurationId.equalsIgnoreCase(locationLevel.attributeDurationId) && - this.attributeComment == null || locationLevel.attributeComment == null ? - Objects.equals(this.attributeComment, locationLevel.attributeComment) : - this.attributeComment.equalsIgnoreCase(locationLevel.attributeComment); + return this.officeId == null || locationLevel.officeId == null ? + Objects.equals(this.officeId, locationLevel.officeId) : + this.officeId.equalsIgnoreCase(locationLevel.officeId) + && this.locationLevelId == null || locationLevel.locationLevelId == null ? + Objects.equals(this.locationLevelId, locationLevel.locationLevelId) : + this.locationLevelId.equalsIgnoreCase(locationLevel.locationLevelId) + && this.specifiedLevelId == null || locationLevel.specifiedLevelId == null ? + Objects.equals(this.specifiedLevelId, locationLevel.specifiedLevelId) : + this.specifiedLevelId.equalsIgnoreCase(locationLevel.specifiedLevelId) + && Objects.equals(this.expirationDate, locationLevel.expirationDate) + && this.parameterId == null || locationLevel.parameterId == null ? + Objects.equals(this.parameterId, locationLevel.parameterId) : + this.parameterId.equalsIgnoreCase(locationLevel.parameterId) + && this.parameterTypeId == null || locationLevel.parameterTypeId == null ? + Objects.equals(this.parameterTypeId, locationLevel.parameterTypeId) : + this.parameterTypeId == locationLevel.parameterTypeId + && this.interpolateString == null || locationLevel.interpolateString == null ? + Objects.equals(this.interpolateString, locationLevel.interpolateString) : + this.interpolateString == locationLevel.interpolateString + && this.levelUnitsId == null || locationLevel.levelUnitsId == null ? + Objects.equals(this.levelUnitsId, locationLevel.levelUnitsId) : + this.levelUnitsId.equalsIgnoreCase(locationLevel.levelUnitsId) + && Objects.equals(this.levelDate, locationLevel.levelDate) + && this.levelComment == null || locationLevel.levelComment == null ? + Objects.equals(this.levelComment, locationLevel.levelComment) : + this.levelComment.equalsIgnoreCase(locationLevel.levelComment) + && this.durationId == null || locationLevel.durationId == null ? + Objects.equals(this.durationId, locationLevel.durationId) : + this.durationId.equalsIgnoreCase(locationLevel.durationId) + && Objects.equals(this.attributeValue, locationLevel.attributeValue) + && this.attributeUnitsId == null || + locationLevel.attributeUnitsId == null ? + Objects.equals(this.attributeUnitsId, locationLevel.attributeUnitsId) : + this.attributeUnitsId.equalsIgnoreCase(locationLevel.attributeUnitsId) + && this.attributeParameterTypeId == null || + locationLevel.attributeParameterTypeId == null ? + Objects.equals(this.attributeParameterTypeId, + locationLevel.attributeParameterTypeId) : + this.attributeParameterTypeId.equalsIgnoreCase( + locationLevel.attributeParameterTypeId) + && this.attributeParameterId == null || + locationLevel.attributeParameterId == null ? + Objects.equals(this.attributeParameterId, + locationLevel.attributeParameterId) : + this.attributeParameterId.equalsIgnoreCase( + locationLevel.attributeParameterId) + && this.attributeDurationId == null || + locationLevel.attributeDurationId == null ? + Objects.equals(this.attributeDurationId, + locationLevel.attributeDurationId) : + this.attributeDurationId.equalsIgnoreCase( + locationLevel.attributeDurationId) + && this.attributeComment == null || + locationLevel.attributeComment == null ? + Objects.equals(this.attributeComment, + locationLevel.attributeComment) : + this.attributeComment.equalsIgnoreCase( + locationLevel.attributeComment) + ; } @Override public int hashCode() { - return Objects.hash(locationLevelId == null ? 0 : locationLevelId.toLowerCase(), officeId == null ? 0 : officeId.toLowerCase(), - seasonalTimeSeriesId == null ? 0 : seasonalTimeSeriesId.toLowerCase(), seasonalValues, - specifiedLevelId == null ? 0 : specifiedLevelId.toLowerCase(), parameterTypeId, parameterId == null ? 0 : parameterId.toLowerCase(), - constantValue, levelUnitsId == null ? 0 : levelUnitsId.toLowerCase(), levelDate, levelComment == null ? 0 : levelComment.toLowerCase(), - intervalOrigin, intervalMonths, intervalMinutes, interpolateString, durationId == null ? 0 : durationId.toLowerCase(), attributeValue, - attributeUnitsId == null ? 0 : attributeUnitsId.toLowerCase(), + return Objects.hash(officeId == null ? 0 : officeId.toLowerCase(), + locationLevelId == null ? 0 : locationLevelId.toLowerCase(), + specifiedLevelId == null ? 0 : specifiedLevelId.toLowerCase(), expirationDate, + parameterId == null ? 0 : parameterId.toLowerCase(), parameterTypeId == null ? 0 : parameterTypeId.name(), + interpolateString == null ? 0 : interpolateString.name(), + levelUnitsId == null ? 0 : levelUnitsId.toLowerCase(), levelDate, + levelComment == null ? 0 : levelComment.toLowerCase(), durationId == null ? 0 : durationId.toLowerCase(), + attributeValue, attributeUnitsId == null ? 0 : attributeUnitsId.toLowerCase(), attributeParameterTypeId == null ? 0 : attributeParameterTypeId.toLowerCase(), attributeParameterId == null ? 0 : attributeParameterId.toLowerCase(), - attributeDurationId == null ? 0 : attributeDurationId.toLowerCase(), attributeComment == null ? 0 : attributeComment.toLowerCase()); + attributeDurationId == null ? 0 : attributeDurationId.toLowerCase(), + attributeComment == null ? 0 : attributeComment.toLowerCase()); } @Override @@ -684,21 +470,16 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class LocationLevel {\n"); - sb.append(" locationLevelId: ").append(toIndentedString(locationLevelId)).append("\n"); sb.append(" officeId: ").append(toIndentedString(officeId)).append("\n"); - sb.append(" seasonalTimeSeriesId: ").append(toIndentedString(seasonalTimeSeriesId)).append("\n"); - sb.append(" seasonalValues: ").append(toIndentedString(seasonalValues)).append("\n"); + sb.append(" locationLevelId: ").append(toIndentedString(locationLevelId)).append("\n"); sb.append(" specifiedLevelId: ").append(toIndentedString(specifiedLevelId)).append("\n"); - sb.append(" parameterTypeId: ").append(toIndentedString(parameterTypeId)).append("\n"); + sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); sb.append(" parameterId: ").append(toIndentedString(parameterId)).append("\n"); - sb.append(" constantValue: ").append(toIndentedString(constantValue)).append("\n"); + sb.append(" parameterTypeId: ").append(toIndentedString(parameterTypeId)).append("\n"); + sb.append(" interpolateString: ").append(toIndentedString(interpolateString)).append("\n"); sb.append(" levelUnitsId: ").append(toIndentedString(levelUnitsId)).append("\n"); sb.append(" levelDate: ").append(toIndentedString(levelDate)).append("\n"); sb.append(" levelComment: ").append(toIndentedString(levelComment)).append("\n"); - sb.append(" intervalOrigin: ").append(toIndentedString(intervalOrigin)).append("\n"); - sb.append(" intervalMonths: ").append(toIndentedString(intervalMonths)).append("\n"); - sb.append(" intervalMinutes: ").append(toIndentedString(intervalMinutes)).append("\n"); - sb.append(" interpolateString: ").append(toIndentedString(interpolateString)).append("\n"); sb.append(" durationId: ").append(toIndentedString(durationId)).append("\n"); sb.append(" attributeValue: ").append(toIndentedString(attributeValue)).append("\n"); sb.append(" attributeUnitsId: ").append(toIndentedString(attributeUnitsId)).append("\n"); @@ -714,7 +495,7 @@ public String toString() { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + String toIndentedString(Object o) { if (o == null) { return "null"; } diff --git a/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/LocationLevelConstituent.java b/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/LocationLevelConstituent.java new file mode 100644 index 00000000..80bb4333 --- /dev/null +++ b/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/LocationLevelConstituent.java @@ -0,0 +1,134 @@ +/* + * MIT License + * + * Copyright (c) 2025 Hydrologic Engineering Center + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package mil.army.usace.hec.cwms.data.api.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * LocationLevelConstituent + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2025-11-17T16:46:44.562396200-08:00[America/Los_Angeles]") +public class LocationLevelConstituent extends RatingConstituent { + + @JsonProperty("attribute-id") + private String attributeId = null; + + @JsonProperty("attribute-value") + private Double attributeValue = null; + + @JsonProperty("attribute-units") + private String attributeUnits = null; + + public LocationLevelConstituent attributeId(String attributeId) { + this.attributeId = attributeId; + return this; + } + + public String getAttributeId() { + return attributeId; + } + + public void setAttributeId(String attributeId) { + this.attributeId = attributeId; + } + + public LocationLevelConstituent attributeValue(Double attributeValue) { + this.attributeValue = attributeValue; + return this; + } + + public Double getAttributeValue() { + return attributeValue; + } + + public void setAttributeValue(Double attributeValue) { + this.attributeValue = attributeValue; + } + + public LocationLevelConstituent attributeUnits(String attributeUnits) { + this.attributeUnits = attributeUnits; + return this; + } + + public String getAttributeUnits() { + return attributeUnits; + } + + public void setAttributeUnits(String attributeUnits) { + this.attributeUnits = attributeUnits; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LocationLevelConstituent locationLevelConstituent = (LocationLevelConstituent) o; + return this.attributeId == null || locationLevelConstituent.attributeId == null ? + Objects.equals(this.attributeId, locationLevelConstituent.attributeId) : + this.attributeId.equalsIgnoreCase(locationLevelConstituent.attributeId) + && Objects.equals(this.attributeValue, locationLevelConstituent.attributeValue) + && this.attributeUnits == null || locationLevelConstituent.attributeUnits == null ? + Objects.equals(this.attributeUnits, locationLevelConstituent.attributeUnits) : + this.attributeUnits.equalsIgnoreCase(locationLevelConstituent.attributeUnits) + && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(attributeId == null ? 0 : attributeId.toLowerCase(), attributeValue, + attributeUnits == null ? 0 : attributeUnits.toLowerCase(), super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LocationLevelConstituent {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" attributeId: ").append(toIndentedString(attributeId)).append("\n"); + sb.append(" attributeValue: ").append(toIndentedString(attributeValue)).append("\n"); + sb.append(" attributeUnits: ").append(toIndentedString(attributeUnits)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/LocationLevels.java b/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/LocationLevels.java index e761d5f2..d0467c2c 100644 --- a/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/LocationLevels.java +++ b/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/LocationLevels.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2024 Hydrologic Engineering Center + * Copyright (c) 2025 Hydrologic Engineering Center * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -28,7 +28,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import jakarta.annotation.Generated; import jakarta.validation.Valid; - import java.util.ArrayList; import java.util.List; import java.util.Objects; diff --git a/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/RadarObjectMapper.java b/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/RadarObjectMapper.java index 922b1a78..945f4166 100644 --- a/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/RadarObjectMapper.java +++ b/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/RadarObjectMapper.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2024 Hydrologic Engineering Center + * Copyright (c) 2025 Hydrologic Engineering Center * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -35,19 +35,16 @@ import java.util.List; import java.util.Set; -/** - * - */ public final class RadarObjectMapper { - private static final ObjectMapper OBJECT_MAPPER = - new ObjectMapper().registerModule(new JavaTimeModule()) - .configure(JsonReadFeature.ALLOW_UNESCAPED_CONTROL_CHARS.mappedFeature(), true) - .configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) - .configure(SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS, false) - .configure(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS, false) - .setSerializationInclusion(JsonInclude.Include.NON_EMPTY) - .configure(JsonReadFeature.ALLOW_MISSING_VALUES.mappedFeature(), true); + private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper() + .registerModule(new JavaTimeModule()) + .configure(JsonReadFeature.ALLOW_UNESCAPED_CONTROL_CHARS.mappedFeature(), true) + .configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) + .configure(SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS, false) + .configure(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS, false) + .setSerializationInclusion(JsonInclude.Include.NON_EMPTY) + .configure(JsonReadFeature.ALLOW_MISSING_VALUES.mappedFeature(), true); private RadarObjectMapper() { throw new AssertionError("Utility class"); diff --git a/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/RatingConstituent.java b/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/RatingConstituent.java new file mode 100644 index 00000000..323966d6 --- /dev/null +++ b/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/RatingConstituent.java @@ -0,0 +1,171 @@ +/* + * MIT License + * + * Copyright (c) 2025 Hydrologic Engineering Center + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package mil.army.usace.hec.cwms.data.api.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import jakarta.validation.Valid; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * RATING + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2025-11-17T16:46:44.562396200-08:00[America/Los_Angeles]") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = LocationLevelConstituent.class, name = "LOCATION_LEVEL"), + @JsonSubTypes.Type(value = RatingConstituent.class, name = "RATING") +}) +public class RatingConstituent { + + @JsonProperty("abbr") + private String abbr = null; + + @JsonProperty("type") + private String type = null; + + @JsonProperty("name") + private String name = null; + + @JsonProperty("constituent-list") + @Valid + private List constituentList = new ArrayList<>(); + + public RatingConstituent abbr(String abbr) { + this.abbr = abbr; + return this; + } + + public String getAbbr() { + return abbr; + } + + public void setAbbr(String abbr) { + this.abbr = abbr; + } + + public RatingConstituent type(String type) { + this.type = type; + return this; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public RatingConstituent name(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public RatingConstituent constituentList(List constituentList) { + this.constituentList = constituentList; + return this; + } + + public RatingConstituent addConstituentListItem(String constituentListItem) { + if (this.constituentList == null) { + this.constituentList = new ArrayList<>(); + } + this.constituentList.add(constituentListItem); + return this; + } + + public List getConstituentList() { + return constituentList; + } + + public void setConstituentList(List constituentList) { + this.constituentList = constituentList; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RatingConstituent ratingConstituent = (RatingConstituent) o; + return this.abbr == null || ratingConstituent.abbr == null ? Objects.equals(this.abbr, ratingConstituent.abbr) : + this.abbr.equalsIgnoreCase(ratingConstituent.abbr) + && this.type == null || ratingConstituent.type == null ? + Objects.equals(this.type, ratingConstituent.type) : + this.type.equalsIgnoreCase(ratingConstituent.type) + && this.name == null || ratingConstituent.name == null ? + Objects.equals(this.name, ratingConstituent.name) : + this.name.equalsIgnoreCase(ratingConstituent.name) + && Objects.equals(this.constituentList, ratingConstituent.constituentList) + ; + } + + @Override + public int hashCode() { + return Objects.hash(abbr == null ? 0 : abbr.toLowerCase(), type == null ? 0 : type.toLowerCase(), + name == null ? 0 : name.toLowerCase(), constituentList); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RATING {\n"); + + sb.append(" abbr: ").append(toIndentedString(abbr)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" constituentList: ").append(toIndentedString(constituentList)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/SeasonalLocationLevel.java b/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/SeasonalLocationLevel.java new file mode 100644 index 00000000..983a7197 --- /dev/null +++ b/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/SeasonalLocationLevel.java @@ -0,0 +1,169 @@ +/* + * MIT License + * + * Copyright (c) 2025 Hydrologic Engineering Center + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package mil.army.usace.hec.cwms.data.api.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import jakarta.validation.Valid; +import java.time.ZonedDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * SeasonalLocationLevel + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2025-11-17T16:46:44.562396200-08:00[America/Los_Angeles]") +@JsonDeserialize() +public class SeasonalLocationLevel extends LocationLevel { + + @JsonProperty("interval-origin") + private ZonedDateTime intervalOrigin = null; + + @JsonProperty("interval-months") + private Integer intervalMonths = null; + + @JsonProperty("interval-minutes") + private Integer intervalMinutes = null; + + @JsonProperty("seasonal-values") + @Valid + private List seasonalValues = new ArrayList<>(); + + public SeasonalLocationLevel intervalOrigin(ZonedDateTime intervalOrigin) { + this.intervalOrigin = intervalOrigin; + return this; + } + + public ZonedDateTime getIntervalOrigin() { + return intervalOrigin; + } + + public void setIntervalOrigin(ZonedDateTime intervalOrigin) { + this.intervalOrigin = intervalOrigin; + } + + public SeasonalLocationLevel intervalMonths(Integer intervalMonths) { + this.intervalMonths = intervalMonths; + return this; + } + + public Integer getIntervalMonths() { + return intervalMonths; + } + + public void setIntervalMonths(Integer intervalMonths) { + this.intervalMonths = intervalMonths; + } + + public SeasonalLocationLevel intervalMinutes(Integer intervalMinutes) { + this.intervalMinutes = intervalMinutes; + return this; + } + + public Integer getIntervalMinutes() { + return intervalMinutes; + } + + public void setIntervalMinutes(Integer intervalMinutes) { + this.intervalMinutes = intervalMinutes; + } + + public SeasonalLocationLevel seasonalValues(List seasonalValues) { + this.seasonalValues = seasonalValues; + return this; + } + + public SeasonalLocationLevel addSeasonalValuesItem(SeasonalValueBean seasonalValuesItem) { + if (this.seasonalValues == null) { + this.seasonalValues = new ArrayList<>(); + } + this.seasonalValues.add(seasonalValuesItem); + return this; + } + + public List getSeasonalValues() { + return seasonalValues; + } + + public void setSeasonalValues(List seasonalValues) { + this.seasonalValues = seasonalValues; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SeasonalLocationLevel seasonalLocationLevel = (SeasonalLocationLevel) o; + return super.equals(o) + && Objects.equals(this.intervalOrigin, seasonalLocationLevel.intervalOrigin) + && Objects.equals(this.intervalMonths, seasonalLocationLevel.intervalMonths) + && Objects.equals(this.intervalMinutes, seasonalLocationLevel.intervalMinutes) + && Objects.equals(this.seasonalValues, seasonalLocationLevel.seasonalValues) + ; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), intervalOrigin, intervalMonths, intervalMinutes, seasonalValues); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SeasonalLocationLevel {\n"); + + sb.append(" officeId: ").append(toIndentedString(getOfficeId())).append("\n"); + sb.append(" locationLevelId: ").append(toIndentedString(getLocationLevelId())).append("\n"); + sb.append(" specifiedLevelId: ").append(toIndentedString(getSpecifiedLevelId())).append("\n"); + sb.append(" expirationDate: ").append(toIndentedString(getExpirationDate())).append("\n"); + sb.append(" parameterId: ").append(toIndentedString(getParameterId())).append("\n"); + sb.append(" parameterTypeId: ").append(toIndentedString(getParameterTypeId())).append("\n"); + sb.append(" interpolateString: ").append(toIndentedString(getInterpolateString())).append("\n"); + sb.append(" levelUnitsId: ").append(toIndentedString(getLevelUnitsId())).append("\n"); + sb.append(" levelDate: ").append(toIndentedString(getLevelDate())).append("\n"); + sb.append(" levelComment: ").append(toIndentedString(getLevelComment())).append("\n"); + sb.append(" durationId: ").append(toIndentedString(getDurationId())).append("\n"); + sb.append(" attributeValue: ").append(toIndentedString(getAttributeValue())).append("\n"); + sb.append(" attributeUnitsId: ").append(toIndentedString(getAttributeUnitsId())).append("\n"); + sb.append(" attributeParameterTypeId: ").append(toIndentedString(getAttributeParameterTypeId())) + .append("\n"); + sb.append(" attributeParameterId: ").append(toIndentedString(getAttributeParameterId())).append("\n"); + sb.append(" attributeDurationId: ").append(toIndentedString(getAttributeDurationId())).append("\n"); + sb.append(" attributeComment: ").append(toIndentedString(getAttributeComment())).append("\n"); + sb.append(" intervalOrigin: ").append(toIndentedString(intervalOrigin)).append("\n"); + sb.append(" intervalMonths: ").append(toIndentedString(intervalMonths)).append("\n"); + sb.append(" intervalMinutes: ").append(toIndentedString(intervalMinutes)).append("\n"); + sb.append(" seasonalValues: ").append(toIndentedString(seasonalValues)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/TimeSeriesLocationLevel.java b/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/TimeSeriesLocationLevel.java new file mode 100644 index 00000000..f4942fa5 --- /dev/null +++ b/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/TimeSeriesLocationLevel.java @@ -0,0 +1,104 @@ +/* + * MIT License + * + * Copyright (c) 2025 Hydrologic Engineering Center + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package mil.army.usace.hec.cwms.data.api.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.Objects; + +/** + * TimeSeriesLocationLevel + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2025-11-12T16:30:51.643037900-08:00[America/Los_Angeles]") +@JsonDeserialize() +public class TimeSeriesLocationLevel extends LocationLevel { + + @JsonProperty("seasonal-time-series-id") + private String seasonalTimeSeriesId = null; + + public TimeSeriesLocationLevel seasonalTimeSeriesId(String seasonalTimeSeriesId) { + this.seasonalTimeSeriesId = seasonalTimeSeriesId; + return this; + } + + public String getSeasonalTimeSeriesId() { + return seasonalTimeSeriesId; + } + + public void setSeasonalTimeSeriesId(String seasonalTimeSeriesId) { + this.seasonalTimeSeriesId = seasonalTimeSeriesId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeSeriesLocationLevel timeSeriesLocationLevel = (TimeSeriesLocationLevel) o; + return super.equals(o) && + this.seasonalTimeSeriesId == null || timeSeriesLocationLevel.seasonalTimeSeriesId == null ? + Objects.equals(this.seasonalTimeSeriesId, timeSeriesLocationLevel.seasonalTimeSeriesId) : + this.seasonalTimeSeriesId.equalsIgnoreCase(timeSeriesLocationLevel.seasonalTimeSeriesId) + ; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), seasonalTimeSeriesId == null ? 0 : seasonalTimeSeriesId.toLowerCase()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeSeriesLocationLevel {\n"); + + sb.append(" officeId: ").append(toIndentedString(getOfficeId())).append("\n"); + sb.append(" locationLevelId: ").append(toIndentedString(getLocationLevelId())).append("\n"); + sb.append(" specifiedLevelId: ").append(toIndentedString(getSpecifiedLevelId())).append("\n"); + sb.append(" expirationDate: ").append(toIndentedString(getExpirationDate())).append("\n"); + sb.append(" parameterId: ").append(toIndentedString(getParameterId())).append("\n"); + sb.append(" parameterTypeId: ").append(toIndentedString(getParameterTypeId())).append("\n"); + sb.append(" interpolateString: ").append(toIndentedString(getInterpolateString())).append("\n"); + sb.append(" levelUnitsId: ").append(toIndentedString(getLevelUnitsId())).append("\n"); + sb.append(" levelDate: ").append(toIndentedString(getLevelDate())).append("\n"); + sb.append(" levelComment: ").append(toIndentedString(getLevelComment())).append("\n"); + sb.append(" durationId: ").append(toIndentedString(getDurationId())).append("\n"); + sb.append(" attributeValue: ").append(toIndentedString(getAttributeValue())).append("\n"); + sb.append(" attributeUnitsId: ").append(toIndentedString(getAttributeUnitsId())).append("\n"); + sb.append(" attributeParameterTypeId: ").append(toIndentedString(getAttributeParameterTypeId())) + .append("\n"); + sb.append(" attributeParameterId: ").append(toIndentedString(getAttributeParameterId())).append("\n"); + sb.append(" attributeDurationId: ").append(toIndentedString(getAttributeDurationId())).append("\n"); + sb.append(" attributeComment: ").append(toIndentedString(getAttributeComment())).append("\n"); + sb.append(" seasonalTimeSeriesId: ").append(toIndentedString(seasonalTimeSeriesId)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/VirtualLocationLevel.java b/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/VirtualLocationLevel.java new file mode 100644 index 00000000..5482cf6a --- /dev/null +++ b/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/VirtualLocationLevel.java @@ -0,0 +1,134 @@ +/* + * MIT License + * + * Copyright (c) 2025 Hydrologic Engineering Center + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package mil.army.usace.hec.cwms.data.api.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import jakarta.validation.Valid; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * VirtualLocationLevel + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2025-11-12T16:30:51.643037900-08:00[America/Los_Angeles]") +@JsonDeserialize() +public class VirtualLocationLevel extends LocationLevel { + + @JsonProperty("constituents") + @Valid + private List constituents = new ArrayList<>(); + + @JsonProperty("constituent-connections") + private String constituentConnections = null; + + public VirtualLocationLevel constituents(List constituents) { + this.constituents = constituents; + return this; + } + + public VirtualLocationLevel addConstituentsItem(RatingConstituent constituentsItem) { + if (this.constituents == null) { + this.constituents = new ArrayList<>(); + } + this.constituents.add(constituentsItem); + return this; + } + + public List getConstituents() { + return constituents; + } + + public void setConstituents(List constituents) { + this.constituents = constituents; + } + + public VirtualLocationLevel constituentConnections(String constituentConnections) { + this.constituentConnections = constituentConnections; + return this; + } + + public String getConstituentConnections() { + return constituentConnections; + } + + public void setConstituentConnections(String constituentConnections) { + this.constituentConnections = constituentConnections; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VirtualLocationLevel virtualLocationLevel = (VirtualLocationLevel) o; + return super.equals(o) && Objects.equals(this.constituents, virtualLocationLevel.constituents) + && this.constituentConnections == null || virtualLocationLevel.constituentConnections == null ? + Objects.equals(this.constituentConnections, virtualLocationLevel.constituentConnections) : + this.constituentConnections.equalsIgnoreCase(virtualLocationLevel.constituentConnections) + ; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), constituents, + constituentConnections == null ? 0 : constituentConnections.toLowerCase()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VirtualLocationLevel {\n"); + + sb.append(" officeId: ").append(toIndentedString(getOfficeId())).append("\n"); + sb.append(" locationLevelId: ").append(toIndentedString(getLocationLevelId())).append("\n"); + sb.append(" specifiedLevelId: ").append(toIndentedString(getSpecifiedLevelId())).append("\n"); + sb.append(" expirationDate: ").append(toIndentedString(getExpirationDate())).append("\n"); + sb.append(" parameterId: ").append(toIndentedString(getParameterId())).append("\n"); + sb.append(" parameterTypeId: ").append(toIndentedString(getParameterTypeId())).append("\n"); + sb.append(" interpolateString: ").append(toIndentedString(getInterpolateString())).append("\n"); + sb.append(" levelUnitsId: ").append(toIndentedString(getLevelUnitsId())).append("\n"); + sb.append(" levelDate: ").append(toIndentedString(getLevelDate())).append("\n"); + sb.append(" levelComment: ").append(toIndentedString(getLevelComment())).append("\n"); + sb.append(" durationId: ").append(toIndentedString(getDurationId())).append("\n"); + sb.append(" attributeValue: ").append(toIndentedString(getAttributeValue())).append("\n"); + sb.append(" attributeUnitsId: ").append(toIndentedString(getAttributeUnitsId())).append("\n"); + sb.append(" attributeParameterTypeId: ").append(toIndentedString(getAttributeParameterTypeId())) + .append("\n"); + sb.append(" attributeParameterId: ").append(toIndentedString(getAttributeParameterId())).append("\n"); + sb.append(" attributeDurationId: ").append(toIndentedString(getAttributeDurationId())).append("\n"); + sb.append(" attributeComment: ").append(toIndentedString(getAttributeComment())).append("\n"); + sb.append(" constituents: ").append(toIndentedString(constituents)).append("\n"); + sb.append(" constituentConnections: ").append(toIndentedString(constituentConnections)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/util/LocationLevelDeserializer.java b/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/util/LocationLevelDeserializer.java new file mode 100644 index 00000000..9531f0b2 --- /dev/null +++ b/cwms-data-api-model/src/main/java/mil/army/usace/hec/cwms/data/api/client/model/util/LocationLevelDeserializer.java @@ -0,0 +1,58 @@ +/* + * MIT License + * + * Copyright (c) 2025 Hydrologic Engineering Center + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package mil.army.usace.hec.cwms.data.api.client.model.util; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import mil.army.usace.hec.cwms.data.api.client.model.ConstantLocationLevel; +import mil.army.usace.hec.cwms.data.api.client.model.LocationLevel; +import mil.army.usace.hec.cwms.data.api.client.model.SeasonalLocationLevel; +import mil.army.usace.hec.cwms.data.api.client.model.TimeSeriesLocationLevel; +import mil.army.usace.hec.cwms.data.api.client.model.VirtualLocationLevel; + +public final class LocationLevelDeserializer extends JsonDeserializer { + + @Override + public LocationLevel deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + ObjectMapper mapper = (ObjectMapper) p.getCodec(); + JsonNode node = mapper.readTree(p); + if (node.has("constituents")) { + return mapper.treeToValue(node, VirtualLocationLevel.class); + } else if (node.has("constant-value")) { + return mapper.treeToValue(node, ConstantLocationLevel.class); + } else if (node.has("seasonal-time-series-id")) { + return mapper.treeToValue(node, TimeSeriesLocationLevel.class); + } else if (node.has("seasonal-values")) { + return mapper.treeToValue(node, SeasonalLocationLevel.class); + } + + throw new IllegalArgumentException("Unable to determine LocationLevel implementation type from JSON"); + } +} +