Make Subscription Source Type Optional #1107
                
     Merged
            
            
          
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
This MR updates the Subscriptions SDK and CLI to make the subscription source
typeparameter optional. For catalog source subscriptions this is a simple change because thecatalogsource type was programmatically appended to the catalog source instead of requiring user input as a positional arg tocatalog_source(). To make thecatalogtype optional then I simply removed the line incatalog_source()that appendscatalogsourcetype.For planetary variable source subscriptions this change is a bit more difficult to make without introducing a breaking change, because the source type is variable and is the first required positional arg to
planetary_variable_source(). To avoid the breaking change, I added a condition toplanetary_variable_source()that checks if thevar_typearg isNoneand only appends the source type if it is notNone. This gives us the desired UX for the CLI which no longer requires the--var-typeparameter, but keeps the positionalvar_typearg inplanetary_variable_source().Note - I did explore the possibility of making the positional
var_typearg optional by counting the number of input args toplanetary_variable_source(), checking their types, and inferring whether or not the user specified thevar_typearg. While this does technically work, I think it would introduce an anti-pattern to the method becausevar_typeis the first positional arg in the method.