Skip to content

Commit

Permalink
Update generation script to support skipping normal network work.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasvl committed Sep 1, 2023
1 parent 2486a12 commit 9fbe96d
Showing 1 changed file with 30 additions and 23 deletions.
53 changes: 30 additions & 23 deletions Tools/GenerateCheckedInServices
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ if [[ $# -ge 1 && ( "$1" == "--no-brief" ) ]] ; then
BRIEF_MODE=
shift
fi
GENERATE_PREFERRED="yes"
if [[ $# -ge 1 && ( "$1" == "--no-preferred" ) ]] ; then
GENERATE_PREFERRED="no"
shift
fi
readonly EXTRA_OPTS=$*

# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -48,37 +53,39 @@ SERVICE_GENERATOR_COMMAND=(
--guessFormattedNames
--httpHeader X-User-IP:0.0.0.0
${BRIEF_MODE}
${EXTRA_OPTS}
# Cloud has a service named "Batch", which means GTLRBatchQuery would be the
# base of the Query classes and thus conflict with the batching support, so
# override the name to avoid the issues.
--formattedName batch=CloudBatch

# Include a filter so there are no warnings/infos during normal generation.
--messageFilter "${ToolsDir}/${ScriptName}-message_filter.json"
)

if [[ "${GENERATE_PREFERRED}" == "yes" ]] ; then
SERVICE_GENERATOR_COMMAND+=(
# Generate everything flagged as preferred.
--generatePreferred

# At least one server from preferred is returning content-type: text/html.
--parseTextHTMLReplies
)

SERVICE_GENERATOR_COMMAND+=(
# The Admin SDK is odd, it is a bunch of 'admin' apis with different versions
# to "group" them (https://www.googleapis.com/discovery/v1/apis?name=admin);
# so only one gets marked as preferred. To generate all of it we have to
# manually fetch anything not preferred which means updating this if there are
# changes. admin:reports_v1 is currently the preferred one in discovery.
'https://admin.googleapis.com/$discovery/rest?version=datatransfer_v1'
'https://admin.googleapis.com/$discovery/rest?version=directory_v1'

# Cloud has a service named "Batch", which means GTLRBatchQuery would be the
# base of the Query classes and thus conflict with the batching support, so
# override the name to avoid the issues.
--formattedName batch=CloudBatch

# Not sure why this is in discovery, turn it off.
--skip prod_tt_sasportal

# Include a filter so there are no warnings/infos during normal generation.
--messageFilter "${ToolsDir}/${ScriptName}-message_filter.json"
)
# The Admin SDK is odd, it is a bunch of 'admin' apis with different versions
# to "group" them (https://www.googleapis.com/discovery/v1/apis?name=admin);
# so only one gets marked as preferred. To generate all of it we have to
# manually fetch anything not preferred which means updating this if there are
# changes. admin:reports_v1 is currently the preferred one in discovery.
'https://admin.googleapis.com/$discovery/rest?version=datatransfer_v1'
'https://admin.googleapis.com/$discovery/rest?version=directory_v1'

# Not sure why this is in discovery, turn it off.
--skip prod_tt_sasportal
)
fi

# Away it goes...
Banner "Running the ServiceGenerator..."
"${SERVICE_GENERATOR_COMMAND[@]}"
"${SERVICE_GENERATOR_COMMAND[@]}" ${EXTRA_OPTS}

# -----------------------------------------------------------------------------

Expand Down

0 comments on commit 9fbe96d

Please sign in to comment.